今天接着昨天的内容,继续讲RouterInterface 的内容
popGroup
/**
* 从数组中,删除最后一个路由
* Removes the last route group from the array
*
*
* @return bool True if successful, else False
*/
public function popGroup();
getNamedRoute 得到路由对象
/**
* Get named route object
*
* @param string $name Route name
*
* @return \Slim\Interfaces\RouteInterface
*
* @throws RuntimeException If named route does not exist
*/
public function getNamedRoute($name);
lookupRoute
/**
* @param $identifier
*
* @return \Slim\Interfaces\RouteInterface
*/
public function lookupRoute($identifier);
relativePathFor
/**
* Build the path for a named route excluding the base path
*
* @param string $name Route name
* @param array $data Named argument replacement data
* @param array $queryParams Optional query string parameters
*
* @return string
*
* @throws RuntimeException If named route does not exist
* @throws InvalidArgumentException If required data not provided
*/
public function relativePathFor($name, array $data = [], array $queryParams = []);
pathFor
/**
* Build the path for a named route including the base path
*
* @param string $name Route name
* @param array $data Named argument replacement data
* @param array $queryParams Optional query string parameters
*
* @return string
*
* @throws RuntimeException If named route does not exist
* @throws InvalidArgumentException If required data not provided
*/
public function pathFor($name, array $data = [], array $queryParams = []);
结束语: 今天太累了,就到这里