繁体   English   中英

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

[英]how to send parameters from one module to another module in joomla

我所做的是,我刚刚在joomla网站上安装了flexi自定义代码模块以使用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值发送到另一个模块中,同时点击链接

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM