Zend Framework disable layout and view rendering

When using Zend Framework, sometimes you need to create a controller action which just does something, doesn’t need to display anything to the user. To disable the layout and the view rendering add the following in your action:

		// disable layout
		$this -> _helper -> layout() -> disableLayout();

		// disable view rendering
		$this -> _helper -> viewRenderer -> setNoRender();

Leave a Reply

Your email address will not be published. Required fields are marked *