Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Yaf_Dispatcher::__constructYaf_Dispatcher::dispatch>
^Yaf_DispatcherLast updated: Mon, 26 Oct 2026

Yaf_Dispatcher::disableView

(Yaf >=1.0.0)

Yaf_Dispatcher::disableView — Disable view rendering

Description

public function Yaf_Dispatcher::disableView(): ?Yaf_Dispatcher

Turn off view rendering. This is typically used for actions that generate their own output, such as actions returning JSON data.

Parameters

This function has no parameters.

Return Values

Returns the Yaf_Dispatcher object itself on success, or null if the application is not initialized.

Examples

Example #1 Yaf_Dispatcher::disableView() example

<?php
$app = new Yaf_Application(dirname(__FILE__) . "/conf/application.ini");

// Turn off view rendering globally, every action is expected to produce
// its output itself (e.g. a JSON API service).
Yaf_Dispatcher::getInstance()->disableView();

$app->run();
?>

See Also


<Yaf_Dispatcher::__constructYaf_Dispatcher::dispatch>
^Yaf_DispatcherLast updated: Mon, 26 Oct 2026