php - joomla中如何将参数从一个模块发送到另一个模块

标签 php mysql joomla

我所做的是我刚刚安装了 Flexi 自定义代码模块以在我的 joomla 网站中使用 php,我创建了一个新数据库而不是 joomla 数据库,我将代码如下所示连接并给出了结果。

$rows = $result->num_rows;    // Find total rows returned by database
if($rows > 0) {
    $cols = 3;    // Define number of columns
    $counter = 1;     // Counter used to identify if we need to start or end a row
    $nbsp = $cols - ($rows % $cols);    // Calculate the number of blank columns

    $container_class = 'container-fluid';  // Parent container class name
    $row_class = 'row';    // Row class name
    $col_class = 'col-sm-4'; // Column class name

    echo '<div class="'.$container_class.'">';    // Container open
    while ($item = $result->fetch_array()) {
        if(($counter % $cols) == 1) {    // Check if it's new row
            echo '<div class="'.$row_class.'">';    // Start a new row
        }
                     $jid=$item['jid'];
                $jdesc = $item['jdesc'];
                    $duration=$item['duration'];
                     $jobtitle=$item['jobtitle'];

echo ('<div class="'.$col_class.'">'.'<h3>'.'<a href="showjob?jid=' . $jid .    '  ">' .$jobtitle . '</a>' .'</br>'.$jdesc.'<br/>'.$duration.'</h3>'.'<h5>'.$item['name'].'</h5></div>');

if(($counter % $cols) == 0) { // If it's last column in each row then counter remainder will be zero
            echo '</div>';   //  Close the row
        }
        $counter++;    // Increase the counter
    }
    $result->free();
    if($nbsp > 0) { // Adjustment to add unused column in last row if they exist
        for ($i = 0; $i < $nbsp; $i++)  { 
            echo '<div class="'.$col_class.'">&nbsp;</div>';        
        }
        echo '</div>';  // Close the row
    }
    echo '</div>';  // Close the container
}
?>

<?php
$conn->close();
?>

它已创建数据库连接并给出了结果,但有了该结果,我想将参数发送到其他模块以显示结果,如何将参数从一个模块发送到另一个模块, 最后,我想在单击链接时将 id 值获取到另一个模块

最佳答案

我解决了这个问题,问题是我们发送到另一个页面的链接正在保存缓存,所以我刚刚安装了缓存管理器插件并添加了特定页面以不想保存缓存。所以问题解决了,现在我可以了轻松从另一个模块向 joomla 模块发送任何参数。

关于php - joomla中如何将参数从一个模块发送到另一个模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36056502/

相关文章:

mysql - 乔姆拉! (使用 K2)MySql - 生成时出错

php - PDO::FETCH_CLASS,构造函数参数怎么写?

SQL 查询的 PHP 输出

php - 如何在 PHP 中轻松简单地安排 cron 作业?

mysql - 如何使用nodejs在具有JSON字段类型的mysql中插入JSON对象?

mysql - 索引并加速 'derived' 查询

php - 从单个表中加入两列

php - 函数返回 1 而不是实际值

php - Google Google App Engine 用于 Joomla 中的静态文件

php - 如何在joomla cms中显示文章? (在自己的html模板中)