Yaf_Dispatcher::autoRender

(Yaf >=1.0.0)

Yaf_Dispatcher::autoRenderSwitch on/off autorendering

Beschreibung

publicYaf_Dispatcher::autoRender(bool$flag = ?): Yaf_Dispatcher

Yaf_Dispatcher will render automatically after dispatches a incoming request, you can prevent the rendering by calling this method with flagtrue

Hinweis:

you can simply return false in a action to prevent the auto-rendering of that action

Parameter-Liste

flag

bool

Hinweis:

since 2.2.0, if this parameter is not given, then the current state will be returned

Rückgabewerte

Beispiele

Beispiel #1 Yaf_Dispatcher::autoRender() example

<?php
class IndexController extends Yaf_Controller_Abstract {

public function init() {
if (
$this->getRequest()->isXmlHttpRequest()) {
//do not call render for ajax request

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

To Top