本文整理匯總了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!");
}