【问题标题】:Joomla Plugin cant seem to access params through module code Joomla 1.7 help pleaseJoomla插件似乎无法通过模块代码访问参数Joomla 1.7帮助请
【发布时间】:2012-08-21 10:02:40
【问题描述】:

我正在使用 jooolma 的简码通过插件加载模块但是我遇到了问题我通过渲染方法加载模块这是我的插件代码

    defined('_JEXEC') or die('Restricted access');

    add_shortcode("mygallery", "sc_mygallery");
    function sc_mygallery($atts, $content = null) {
      extract(shortcode_atts(array(
        "galleryid" => 'galleryid=oHg5SJYRHA0',
        "width" => '480',
        "height" => '360',
        "allowfullscreen" => 'true',    
      ), $atts));


    $module_name='mod_eastbelfastpics';
    $moudle_title='East Belfast Gallery!';
    $module = JModuleHelper::getModule($module_name, $module_title); 

    $module->params = array('Gallery' => $galleryid);
    echo JModuleHelper::renderModule($module ,$options);


    }

但是当我输出 Gallery 的值时,我只是没有输出什么问题,这是我的前端代码

    <?php
    defined('_JEXEC') or die('Restricted access');

    $items = $params->get('items', 1);
    $db =& JFactory::getDBO();
    $query = "SELECT * from jos_eastbelfastpagegallery_images";
    $db->setQuery( $query, 0 , $items );
    $rows = $db->loadObjectList();
    $galleryid= $params->get('Gallery');
     ?>

    this is content comming from a module form a content plugin ;-)

    <?php echo $galleryid;?>

【问题讨论】:

  • 不要定义您的实际数据库前缀。而是使用#__eastbelfastpagegallery_images

标签: php joomla


【解决方案1】:

$options 没有定义。

使用渲染模块时要传递的合适参数定义 $options。

【讨论】:

    猜你喜欢
    • 2011-07-28
    • 2012-01-24
    • 2012-02-01
    • 1970-01-01
    • 2011-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多