Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework 视图中的renderWidget不执行任何操作_Zend Framework_Socialengine - Fatal编程技术网

Zend framework 视图中的renderWidget不执行任何操作

Zend framework 视图中的renderWidget不执行任何操作,zend-framework,socialengine,Zend Framework,Socialengine,我试图为会员们添加一种评论文章的方式。根据我收集的信息,它应该简单到使用: <?php echo $this->content()->renderWidget('modulename.widget-name') ?> 在我看来,这是我的尝试: <div> <?php echo("<h2>".$this->news['title']."</h2>"); print_r($this->news['news']);

我试图为会员们添加一种评论文章的方式。根据我收集的信息,它应该简单到使用:

<?php echo $this->content()->renderWidget('modulename.widget-name') ?>

在我看来,这是我的尝试:

<div>

<?php
echo("<h2>".$this->news['title']."</h2>");

print_r($this->news['news']);

echo $this->content()->renderWidget('core.comment')

?>   

</div>

我的页面底部似乎只有一个空的
标签

有人知道我做错了什么吗


编辑:适用于
'core.admin dashboard'
,但不适用于
'core.comment'
。这是为什么?

Widget core.comment仅当您放置此小部件的页面具有主题且该主题具有“comments”和“like”方法时才会出现:

if( !($subject instanceof Core_Model_Item_Abstract) ||
    !$subject->getIdentity() ||
    (!method_exists($subject, 'comments') && !method_exists($subject, 'likes')) ) {
  return $this->setNoRender();
}
希望这有帮助