本文整理汇总了PHP中route::setAction方法的典型用法代码示例。如果您正苦于以下问题:PHP route::setAction方法的具体用法?PHP route::setAction怎么用?PHP route::setAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类route
的用法示例。
在下文中一共展示了route::setAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTpl
public function getTpl($config)
{
list($group, $subGroup, $controller, $action) = explode(':', $config['controller']);
$className = 'src\\' . $group . '\\Controller\\' . $subGroup . '\\' . $controller . 'Controller';
$action = $action . 'Action';
$this->route->setAction($action);
$this->route->setParameters(isset($config['parameters']) ? $config['parameters'] : array());
return $this->container->doAction($className, $action, isset($config['parameters']) ? $config['parameters'] : array(), $this->container->getRequest());
}
示例2: controller
/**
* do the controller
*
* @param routing config
* @return string
*/
public function controller($config)
{
list($group, $subGroup, $controller, $action) = explode(':', $config['controller']);
$className = 'src\\' . $group . '\\Controller\\' . $subGroup . '\\' . $controller . 'Controller';
$action = $action . 'Action';
$this->route->setAction($action);
$this->route->setParameters(isset($config['parameters']) ? $config['parameters'] : array());
$response = $this->container->doAction($className, $action, isset($config['parameters']) ? $config['parameters'] : array(), $this->request);
\EventDispatcher::dispatch('kernal.response', new HttpEvent($response));
}