本文整理汇总了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);
}