本文整理匯總了PHP中Symfony\Bundle\FrameworkBundle\Controller\Controller::redirectToRoute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Controller::redirectToRoute方法的具體用法?PHP Controller::redirectToRoute怎麽用?PHP Controller::redirectToRoute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Bundle\FrameworkBundle\Controller\Controller
的用法示例。
在下文中一共展示了Controller::redirectToRoute方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: redirectToRoute
public function redirectToRoute($route, array $parameters = array(), $status = 302)
{
if ($route instanceof Request) {
$route = $route->get('_route', 'error_no_route_specified');
}
return parent::redirectToRoute($route, $parameters, $status);
}
示例2: redirectToRoute
public function redirectToRoute($route, array $parameters = array(), $status = 302)
{
return parent::redirectToRoute($route, $parameters, $status);
}
示例3: redirectToRoute
/**
* {@inheritdoc}
*
* Symfony <2.6 BC. To be removed.
*/
protected function redirectToRoute($route, array $parameters = array(), $status = 302)
{
if (method_exists('Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller', 'redirectToRoute')) {
return parent::redirectToRoute($route, $parameters, $status);
}
return $this->redirect($this->generateUrl($route, $parameters), $status);
}
示例4: redirectToRoute
protected function redirectToRoute($route, array $parameters = array(), $status = 302)
{
if (!array_key_exists('project', $parameters)) {
if (!is_null($this->project)) {
$parameters['project'] = $this->project->getIdentifier();
}
}
return parent::redirectToRoute($route, $parameters, $status);
}