Joomla Plugin似乎无法通过模块代码Joomla 1.7帮助访问params

时间:2012-08-21 10:02:40

标签: php joomla

我使用jooolma的短代码通过插件加载模块但是我遇到了一个问题我通过render方法加载模块这是我的插件代码

    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;?>

1 个答案:

答案 0 :(得分:0)

$ options未定义。

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