0

我有两个模块。

  1. 自定义页脚。
  2. 见证。

现在我正在尝试在自定义页脚中显示推荐模块。就像我添加的另一个stackoverflow帖子一样

// Display testimonial part
        $this->data['testimonial_block'] = $module = $this->getChild('module/testimonial', array(
        'limit' => 5,
        'image_width' => 80,
        'image_height' => 80
        ));

"catalog/controller/common/customfooter.php"之前$this->render ();

<?php echo $testimonial_block; ?>在里面添加customfooter.tpl

添加后我收到此错误

Notice: Undefined index: testimonial_title in C:\xampp\htdocs\magichomegym\catalog\controller\module\testimonial.php on line 6
Notice: Undefined index: testimonial_limit in C:\xampp\htdocs\magichomegym\catalog\controller\module\testimonial.php on line 22

有谁知道我哪里出错了?

4

1 回答 1

2

您需要在数组中提供相关数据

$this->data['testimonial_block'] = $module = $this->getChild('module/testimonial', array(
    'limit' => 5,
    'image_width' => 80,
    'image_height' => 80,
    'testimonial_title' => 'Title here',
    'testimonial_limit' => 5,
));

将 5 替换为您想要显示的推荐数量,并将“此处的标题”替换为您想要的标题

于 2013-01-30T18:50:56.577 回答