PHP 8.6.0 Beta 3 is available for testing

Yaf_Dispatcher::setDefaultAction

(Yaf >=1.0.0)

Yaf_Dispatcher::setDefaultActionChange default action name

Опис

public function Yaf_Dispatcher::setDefaultAction(string $action): Yaf_Dispatcher|null|false

Change the action name which is used when an action name can not be extracted from the request URI. The name is normalized to lowercase.

Параметри

action

The name of the action.

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

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

Приклади

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

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

// Requests without an action part are now routed to "main" instead of
// "index", e.g. /user maps to UserController::mainAction
Yaf_Dispatcher::getInstance()->setDefaultAction("main");

$app->run();
?>

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

add a note

User Contributed Notes

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