0

I'm working in ZF2 and have worked in Yii. What I want to know is if there's any way for rendering a page partially, like in Yii. I mean rendering only the code on view page and not adding header & footer to the rendered view. I'm trying this to render a view page in a different module/controller using ajax.

Thorsten S.
  • 4,144
  • 27
  • 41
netmantle
  • 11
  • 2
  • Your question is ambiguous, you need to use renderPartial functionality in zend or yii? If you want to use in zend, please remove yii tag. – hamed Jun 06 '15 at 07:48

1 Answers1

1

Yes, you can disable the layout on a view model, which will tell the renderer to only render the specific view you return from your controller action.

public function doSomethingCrazyAction()
{
    $view = new ViewModel(array(
        'message' => 'Hello world',
    ));

    // Disable layouts; `MvcEvent` will use this View Model instead
    $view->setTerminal(true);

    return $view;
}

See http://framework.zend.com/manual/current/en/modules/zend.view.quick-start.html

dualmon
  • 1,225
  • 1
  • 8
  • 16