本文整理汇总了PHP中route::getRoutes方法的典型用法代码示例。如果您正苦于以下问题:PHP route::getRoutes方法的具体用法?PHP route::getRoutes怎么用?PHP route::getRoutes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类route
的用法示例。
在下文中一共展示了route::getRoutes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFacadeAccessor
protected static function getFacadeAccessor()
{
if (!static::$__url) {
$routes = route::getRoutes();
static::$__url = new base_routing_urlgenerator($routes, request::instance());
}
return static::$__url;
}
示例2: command_cache
public function command_cache()
{
if ($this->files->exists(kernel::getCachedRoutesPath())) {
$this->command_clear();
}
if (!$this->files->isWritable(dirname(kernel::getCachedRoutesPath()))) {
logger::info(sprintf('Route cache path:%s cannot write', kernel::getCachedRoutesPath()));
exit;
}
$routes = route::getRoutes();
if (count($routes) == 0) {
logger::info("Your application doesn't have any routes.");
exit;
}
foreach ($routes as $route) {
$route->prepareForSerialization();
}
$this->files->put(kernel::getCachedRoutesPath(), $this->buildRouteCacheFile($routes));
logger::info("Routes cached successfully!");
}