<?php
// auto-generated by sfRoutingConfigHandler
// date: 2010/03/14 00:46:57
return array(
'addTopic' => new sfRoute( 'blogs/add-topic/' , array (
'module' => 'blogsEdit' ,
'action' => 'addTopic' ,
), array (), array ()),
'editTopic' => new sfRoute( 'blogs/edit-topic/:id/' , array (
'module' => 'blogsEdit' ,
'action' => 'editTopic' ,
), array (), array ()),
'themeBlog' => new sfRoute( 'blogs/:name/' , array (
'module' => 'blogs' ,
'action' => 'blog' ,
), array (), array ())
// .. ..
);
* This source code was highlighted with Source Code Highlighter .
<?php
// auto-generated by sfRoutingConfigHandler
// date: 2010/03/14 00:46:57
$ this ->routes[ 'route-1' ] = unserialize( ' ' );
$ this ->routes[ 'route-2' ] = unserialize( ' ' );
$ this ->routes[ 'route-6' ] = unserialize( ' ' );
$ this ->routes[ 'route-7' ] = unserialize( ' ' );
$ this ->routes[ 'route-8' ] = unserialize( ' ' );
$ this ->routes[ 'route-9' ] = unserialize( ' ' );
$ this ->routes[ 'route-10' ] = unserialize( ' ' );
$ this ->routes[ 'route-11' ] = unserialize( ' ' );
$ this ->routes[ 'route-12' ] = unserialize( ' ' );
$ this ->routes[ 'homepage' ] = unserialize( ' ' );
$ this ->routes[ 'default_index' ] = unserialize( ' ' );
$ this ->routes[ 'default' ] = unserialize( ' ' );
* This source code was highlighted with Source Code Highlighter .
# blog
addTopic:
pattern: blogs/add-topic/
defaults: { module: blogsEdit, action: addTopic }
editTopic:
pattern: blogs/edit-topic/:id/
defaults: { module: blogsEdit, action: editTopic }
themeBlog:
pattern: blogs/:name/
defaults: { module: blogs, action: blog }
* This source code was highlighted with Source Code Highlighter .
<?php
/**
* ProjectUrlMatcher
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlMatcher extends Symfony\\Components\\Routing\\Matcher\\UrlMatcher
{
/**
* Constructor.
*/
public function __construct(array $context = array(), array $defaults = array())
{
$ this ->context = $context;
$ this ->defaults = $defaults;
}
public function match($url)
{
$url = $ this ->normalizeUrl($url);
if (0 === strpos($url, '/blogs/add-topic' ) && preg_match( '#^/blogs/add\-topic$#x' , $url, $matches))
return array_merge($ this ->mergeDefaults($matches, array ( 'module' => 'blogsEdit' , 'action' => 'addTopic' ,)), array( '_route' => 'addTopic' ));
if (0 === strpos($url, '/blogs/edit-topic' ) && preg_match( '#^/blogs/edit\-topic/(?P<id>[^/\.]+?)$#x' , $url, $matches))
return array_merge($ this ->mergeDefaults($matches, array ( 'module' => 'blogsEdit' , 'action' => 'editTopic' ,)), array( '_route' => 'editTopic' ));
if (0 === strpos($url, '/blogs' ) && preg_match( '#^/blogs/(?P<name>[^/\.]+?)$#x' , $url, $matches))
return array_merge($ this ->mergeDefaults($matches, array ( 'module' => 'blogs' , 'action' => 'blog' ,)), array( '_route' => 'themeBlog' ));
// ..
return false ;
}
}
* This source code was highlighted with Source Code Highlighter .
<?php
/**
* ProjectUrlGenerator
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class ProjectUrlGenerator extends Symfony\\Components\\Routing\\Generator\\UrlGenerator
{
/**
* Constructor.
*/
public function __construct(array $context = array(), array $defaults = array())
{
$ this ->context = $context;
$ this ->defaults = $defaults;
}
public function generate($name, array $parameters, $absolute = false )
{
if (!method_exists($ this , $method = 'get' .$name. 'RouteInfo' ))
{
throw new InvalidArgumentException(sprintf( 'Route "%s" does not exist.' , $name));
}
list($variables, $defaults, $tokens) = $ this ->$method();
return $ this ->doGenerate($variables, $defaults, $tokens, $parameters, $name, $absolute);
}
protected function getaddTopicRouteInfo()
{
return array(array (), array_merge($ this ->defaults, array ( 'module' => 'blogsEdit' , 'action' => 'addTopic' ,)), array ( 0 => array ( 0 => 'text' , 1 => '/' , 2 => '' , 3 => NULL, ), 1 => array ( 0 => 'text' , 1 => '/' , 2 => 'add-topic' , 3 => NULL, ), 2 => array ( 0 => 'text' , 1 => '/' , 2 => 'blogs' , 3 => NULL, ),));
}
protected function geteditTopicRouteInfo()
{
return array(array ( 'id' => ':id' ,), array_merge($ this ->defaults, array ( 'module' => 'blogsEdit' , 'action' => 'editTopic' ,)), array ( 0 => array ( 0 => 'text' , 1 => '/' , 2 => '' , 3 => NULL, ), 1 => array ( 0 => 'variable' , 1 => '/' , 2 => ':id' , 3 => 'id' , ), 2 => array ( 0 => 'text' , 1 => '/' , 2 => 'edit-topic' , 3 => NULL, ), 3 => array ( 0 => 'text' , 1 => '/' , 2 => 'blogs' , 3 => NULL, ),));
}
protected function getthemeBlogRouteInfo()
{
return array(array ( 'name' => ':name' ,), array_merge($ this ->defaults, array ( 'module' => 'blogs' , 'action' => 'blog' ,)), array ( 0 => array ( 0 => 'text' , 1 => '/' , 2 => '' , 3 => NULL, ), 1 => array ( 0 => 'variable' , 1 => '/' , 2 => ':name' , 3 => 'name' , ), 2 => array ( 0 => 'text' , 1 => '/' , 2 => 'blogs' , 3 => NULL, ),));
}
}
* This source code was highlighted with Source Code Highlighter .
RewriteCond %{PATH_INFO} ^/blogs/add\-topic/$
RewriteRule .* index.php [QSA,L,E=_ROUTING__route:addTopic,E=_ROUTING_module:blogsEdit,E=_ROUTING_action:addTopic]
RewriteCond %{PATH_INFO} ^/blogs/edit\-topic/([^/\.]+?)/$
RewriteRule .* index.php [QSA,L,E=_ROUTING__route:editTopic,E=_ROUTING_id:%1,E=_ROUTING_module:blogsEdit,E=_ROUTING_action:editTopic]
RewriteCond %{PATH_INFO} ^/blogs/([^/\.]+?)/([^/\.]+?)/$
RewriteRule .* index.php [QSA,L,E=_ROUTING__route:topicInThemeBlog,E=_ROUTING_name:%1,E=_ROUTING_id:%2,E=_ROUTING_module:blogs,E=_ROUTING_action:topic]
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/87511/
All Articles