企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# Class **Phalcon\Cli\Router\Route**[](# "永久链接至标题") This class represents every route added to the router ### Constants[](# "永久链接至标题") *string***DEFAULT_DELIMITER** ### Methods[](# "永久链接至标题") public **__construct** (*string* $pattern, [*array* $paths]) Phalcon\Cli\Router\Route constructor public **compilePattern** (*unknown* $pattern) Replaces placeholders from pattern returning a valid PCRE regular expression public *array|boolean***extractNamedParams** (*string* $pattern) Extracts parameters from a string public **reConfigure** (*string* $pattern, [*array* $paths]) Reconfigure the route adding a new pattern and a set of paths public **getName** () Returns the route's name public **setName** (*unknown* $name) Sets the route's name ~~~ <?php $router->add('/about', array( 'controller' => 'about' ))->setName('about'); ~~~ public [*Phalcon\Cli\Router\Route*]()**beforeMatch** (*callback* $callback) Sets a callback that is called if the route is matched. The developer can implement any arbitrary conditions here If the callback returns false the route is treated as not matched public *mixed***getBeforeMatch** () Returns the ‘before match' callback if any public **getRouteId** () Returns the route's id public **getPattern** () Returns the route's pattern public **getCompiledPattern** () Returns the route's compiled pattern public **getPaths** () Returns the paths public **getReversedPaths** () Returns the paths using positions as keys and names as values public [*Phalcon\Cli\Router\Route*]()**convert** (*string* $name, *callable* $converter) Adds a converter to perform an additional transformation for certain parameter public **getConverters** () Returns the router converter public static **reset** () Resets the internal route id generator public static **delimiter** ([*unknown* $delimiter]) Set the routing delimiter public static **getDelimiter** () Get routing delimiter | - [索引](# "总目录") - [下一页](# "Class Phalcon\Config") | - [上一页](# "Class Phalcon\Cache\Multiple") | - [API Indice](#) »