ZEND, rendering different view with data

16,533

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.

Share:
16,533

Related videos on Youtube

canimbenim
Author by

canimbenim

Updated on June 04, 2022

Comments

  • canimbenim
    canimbenim almost 2 years

    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->renderScript('index/index.phtml')->entries = $result;
    

    But my if:

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

    return 0

    Do You know how to do it? THANKS!

  • DS9
    DS9 almost 10 years
    what is the meaning of ,null, true in this line: $this->_helper->viewRenderer('index/index', null, true); i look in documentation but didn't found out.
  • Phil
    Phil almost 10 years
    @DS9 It's a call to the direct() method which in turn calls setRender(). Second argument is responseSegment name, third is the noController boolean flag (doesn't attempt to prefix the path with the current controller name)
  • DS9
    DS9 almost 10 years
    Thanks, it is useful.

Related