PHP 8.5.10 Released!

Yaf_Dispatcher::getDefaultAction

(Yaf >=3.2.0)

Yaf_Dispatcher::getDefaultActionRetrieve the default action name

Опис

public function Yaf_Dispatcher::getDefaultAction(): ?string

Get the default action name, which is used when an action name can not be extracted from the request URI. Defaults to "index".

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

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

Приклади

Приклад #1 Yaf_Dispatcher::getDefaultAction() example

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

$dispatcher = Yaf_Dispatcher::getInstance();

var_dump($dispatcher->getDefaultAction());

$dispatcher->setDefaultAction("main");
var_dump($dispatcher->getDefaultAction());
?>

Поданий вище приклад виведе щось схоже на:

string(5) "index"
string(4) "main"

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top