开发者

ZEND, rendering different view with data

I have a problem as I want to render view from different controller and pass there datas. Do You know how to do it?

I was trying:

$this-&开发者_Go百科gt;renderScript('index/index.phtml')->entries = $result;

But my if:

if (count($this->entries) <= 0)

return 0

Do You know how to do it? THANKS!


Do you mean you just want to render a different controller action's view script?

$this->view->entries = $result;
$this->_helper->viewRenderer('index/index', null, true);

Check out the manual page for the ViewRenderer helper.


Render view with action's output data.

in view page you wish to display data write this simple code.

echo $this->action('list','users','main');

list is my action name

users is my controller name

main is my module name (if module using in your project).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜