本文整理汇总了PHP中core\Router::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::error方法的具体用法?PHP Router::error怎么用?PHP Router::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core\Router
的用法示例。
在下文中一共展示了Router::error方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
Router::any('rests/update', 'Controllers\\Rests@update_restaurant');
Router::any('rests/update_all', 'Controllers\\Rests@update_all');
Router::any('rests', 'Controllers\\Rests@index');
Router::any('rest/(:num)/delivery_report', 'Controllers\\Rests@delivery_report');
Router::any('delivery_report/(:num)', 'Controllers\\Rests@delivery_report');
Router::any('delivery/(:num)', 'Controllers\\Rests@delivery_report');
Router::any('dishes/parse/(:num)', 'Controllers\\Rests@parse');
Router::any('dishes/parse_all', 'Controllers\\Rests@parse_all');
Router::any('ping', 'Controllers\\Rests@ping');
Router::any('login', 'Controllers\\Auth@login');
Router::any('register', 'Controllers\\Auth@register');
Router::any('logout', 'Controllers\\Auth@logout');
Router::any('user/dishes', 'Controllers\\User@dishes');
Router::any('user/rand_dish', 'Controllers\\User@rand_dish');
Router::any('favorite/(:num)/(:num)', 'Controllers\\User@manage_favorite');
Router::any('favorite/(:num)', 'Controllers\\User@manage_favorite');
Router::any('search', 'Controllers\\Search@search_post');
Router::any('search/(:any)', 'Controllers\\Search@search');
Router::any('advanced_search', 'Controllers\\Search@advanced_search');
Router::any('json/search', 'Controllers\\Json@search');
Router::any('json/all_dishes', 'Controllers\\Json@all_dishes');
Router::any('', 'Controllers\\Welcome@index');
//module routes
$hooks = Hooks::get();
$hooks->run('routes');
//if no route found
Router::error('Core\\Error@index');
//turn on old style routing
Router::$fallback = false;
//execute matched routes
Router::dispatch();
示例2:
<?php
/**
* Routes - all standard routes are defined here.
*
* @author David Carr - dave@daveismyname.com
* @version 3.0
*/
use Core\Router;
use Helpers\Hooks;
/** Define static routes. */
// Default Routing
Router::any('', 'App\\Controllers\\Welcome@index');
Router::any('subpage', 'App\\Controllers\\Welcome@subPage');
Router::any('admin/(:any)(/(:any)(/(:any)(/(:any))))', 'App\\Controllers\\Demo@test');
// The Framework's Language Changer.
Router::any('language/(:any)', 'App\\Controllers\\Language@change');
/** End default Routes */
/** Module Routes. */
$hooks = Hooks::get();
$hooks->run('routes');
/** End Module Routes. */
/** If no Route found. */
Router::error('App\\Controllers\\Error@index');