本文整理匯總了PHP中Phalcon\Mvc\Router::setEventsManager方法的典型用法代碼示例。如果您正苦於以下問題:PHP Router::setEventsManager方法的具體用法?PHP Router::setEventsManager怎麽用?PHP Router::setEventsManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phalcon\Mvc\Router
的用法示例。
在下文中一共展示了Router::setEventsManager方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Router
<?php
/**
* @var \Phalcon\Events\Manager $eventsManager
*/
use Phalcon\Mvc\Router;
$router = new Router();
$router->removeExtraSlashes(true);
if (!isset($_GET['_url'])) {
$router->setUriSource(Router::URI_SOURCE_SERVER_REQUEST_URI);
}
$router->setEventsManager($eventsManager);
$router->add('/:controller', ['controller' => 1, 'action' => 'index'])->setName('front.controller');
$router->add('/contact-us', ['controller' => 'contact', 'action' => 'index'])->setName('front.contact');
$router->add('/login', ['controller' => 'session', 'action' => 'index'])->setName('login.route');
$route = $router->add('/signin', ['controller' => 'session', 'action' => 'index']);
$route->setName('domain.route');
$route->setHostName('join.phalcon.demo');
$router->add('/profile/edit', ['controller' => 'profile', 'action' => 'edit'])->setName('profile.edit');
$router->add('/:controller/:action/:params', ['controller' => 1, 'action' => 2, 'params' => 3])->setName('front.full');
return $router;
示例2: setEventsManager
public function setEventsManager(ManagerInterface $eventsManager)
{
parent::setEventsManager($eventsManager);
}