本文整理匯總了PHP中Symfony\Bundle\FrameworkBundle\Routing\Router::match方法的典型用法代碼示例。如果您正苦於以下問題:PHP Router::match方法的具體用法?PHP Router::match怎麽用?PHP Router::match使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Bundle\FrameworkBundle\Routing\Router
的用法示例。
在下文中一共展示了Router::match方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: match
/**
* @param string $pathinfo
* @return boolean
*/
public function match($pathinfo)
{
if (null !== $this->parent) {
return $this->parent->match($pathinfo);
}
return parent::match($pathinfo);
}
示例2: updateNavigationHistory
/**
* Update navigation history with route names and parameters
*
* @param QueryBag $queries
*/
protected function updateNavigationHistory(QueryBag $queries)
{
$queryBuilder = $this->em->getRepository('OroNavigationBundle:NavigationHistoryItem')->createQueryBuilder('h')->select('h.id, h.url');
$paginator = new Paginator($queryBuilder, false);
foreach ($paginator as $navItem) {
try {
$url = str_replace('app_dev.php/', '', $navItem['url']);
$routeData = $this->router->match($url);
$entityId = isset($routeData['id']) ? (int) $routeData['id'] : null;
$route = $routeData['_route'];
unset($routeData['_controller'], $routeData['id'], $routeData['_route']);
$queries->addPostQuery(sprintf('UPDATE oro_navigation_history ' . 'SET route = \'%s\', entity_id = %d, route_parameters=\'%s\' WHERE id = %d', $route, $entityId, serialize($routeData), $navItem['id']));
} catch (\RuntimeException $e) {
$queries->addPostQuery(sprintf('UPDATE oro_navigation_history SET route_parameters = \'%s\' WHERE id=%d', serialize([]), $navItem['id']));
}
}
}
示例3: match
/**
* {@inheritdoc}
*/
public function match($pathinfo)
{
$this->setApiVersion();
return parent::match($pathinfo);
}
示例4: match
/**
* {@inheritdoc}
*/
public function match($pathinfo)
{
$match = parent::match($pathinfo);
$this->setMatchContext($match);
return $match;
}
示例5: match
/**
* {@inheritdoc}
*/
public function match($url)
{
return $this->matchI18n(parent::match($url), $url);
}
示例6: match
/**
* @param string $pathinfo
* @return array
*/
public function match($pathinfo)
{
$match = parent::match($pathinfo);
return $this->processMatch($match);
}