« Yaf_Dispatcher::getDefaultAction
Yaf_Dispatcher::getDefaultModule »

Yaf_Dispatcher::getDefaultController

(Yaf >=3.2.0)

Yaf_Dispatcher::getDefaultController — Retrieve the default controller name

説明

public function Yaf_Dispatcher::getDefaultController(): ?string

Get the default controller name, which is used when a controller name can not be extracted from the request URI. Defaults to "Index".

パラメータ

この関数にはパラメータはありません。

戻り値

The default controller name, or null if the application is not initialized.

例

例1 Yaf_Dispatcher::getDefaultController() example

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

var_dump(Yaf_Dispatcher::getInstance()->getDefaultController());
?>

上の例の出力は、 たとえば以下のようになります。

string(5) "Index"

参考

関連キーワード:
Dispatcher   controller   default   getDefaultController   Retrieve   Index   application   getDefaultAction   getDefaultModule   used   extracted   request   Defaults   initialized   example   Application   dirname   conf   dump   getInstance   参考   setDefaultController   コントローラ
関連する関数・ページ:
yaf-dispatcher.getdefaultmodule   yaf-dispatcher.setdefaultcontroller   yaf-dispatcher.getdefaultaction   yaf-dispatcher.construct   yaf-dispatcher.setdefaultmodule   yaf-dispatcher.getinstance