本文整理汇总了PHP中core\Router::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::get方法的具体用法?PHP Router::get怎么用?PHP Router::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core\Router
的用法示例。
在下文中一共展示了Router::get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: routes
public function routes()
{
Router::any('blog', 'Modules\\Blog\\Controllers\\Blog@index');
Router::any('blog/(:num)', 'Modules\\Blog\\Controllers\\Blog@index');
Router::any('blog/drafts', 'Modules\\Blog\\Controllers\\Blog@drafts');
Router::any('blog/drafts/(:num)', 'Modules\\Blog\\Controllers\\Blog@drafts');
Router::any('blog/my', 'Modules\\Blog\\Controllers\\Blog@my');
Router::any('blog/my/(:num)', 'Modules\\Blog\\Controllers\\Blog@my');
Router::any('blog/scheduled', 'Modules\\Blog\\Controllers\\Blog@scheduled');
Router::any('blog/scheduled/(:num)', 'Modules\\Blog\\Controllers\\Blog@scheduled');
Router::any('blog/category/(:any)', 'Modules\\Blog\\Controllers\\Blog@category');
Router::any('blog/category/(:any)/(:num)', 'Modules\\Blog\\Controllers\\Blog@category');
Router::any('blog/post/(:any)', 'Modules\\Blog\\Controllers\\Blog@post');
Router::get('blog/check-for-new-posts/(:num)/(:num)', 'Modules\\Blog\\Controllers\\Blog@checkForNewPosts');
Router::any('blog/add', 'Modules\\Blog\\Controllers\\Blog@add');
Router::any('blog/edit/(:num)', 'Modules\\Blog\\Controllers\\Blog@edit');
Router::any('blog/delete/(:num)', 'Modules\\Blog\\Controllers\\Blog@delete');
Router::any('blog/search/(:any)', 'Modules\\Blog\\Controllers\\Blog@search');
Router::any('blog/search/(:any)/(:num)', 'Modules\\Blog\\Controllers\\Blog@search');
Router::any('blog/comment/add', 'Modules\\Blog\\Controllers\\Blog@commentsAdd');
Router::any('blog/comment/delete/(:num)', 'Modules\\Blog\\Controllers\\Blog@commentsDelete');
}
示例2: array
<?php
/**
* Created by PhpStorm.
* User: Otas
* Date: 24. 11. 2015
* Time: 22:26
*/
require_once '../vendor/autoload.php';
use core\Router;
use core\Request;
Router::get('home/hovno/{id}/{user}', array('home_controller', 'index'));
Router::get('home/users/neco/nevim/{id}/{user}/{gender}', array('user_controller', 'index'));
Router::post('home/{str}/{int}', array('home', 'index'));
Router::printRoutes();
$r = new Request();
Router::Dispatch($r);
?>
<form action="home" method="post">
<input type="text" name="hovno">
<input type="text" name="hovdsdno">
<input type="submit">
</form>
示例3:
use Helpers\Hooks;
/* Landing sectie */
Router::any('', 'Controllers\\Home@index');
Router::any('home', 'Controllers\\Home@index');
Router::any('overons', 'Controllers\\Home@overons');
Router::any('contact', 'Controllers\\Contact@index');
Router::any('developers', 'Controllers\\Home@developers');
/* Boten sectie */
Router::any('boten', 'Controllers\\Boten@index');
/* Cursussen sectie */
Router::any('cursussen', 'Controllers\\Cursussen@index');
Router::any('cursussen/validatie', 'Controllers\\Cursussen@validatie');
/* User sectie */
Router::any('login', 'Controllers\\Login@index');
Router::any('registreren', 'Controllers\\Registreren@index');
Router::get('registreren/(:all)', 'Controllers\\Registreren@post');
Router::any('activatie', 'Controllers\\Registreren@activatie');
Router::any('profiel', 'Controllers\\Profiel@index');
Router::any('loguit', 'Controllers\\Login@loguit');
/* beheer sectie */
Router::any('beheer', 'Controllers\\Beheer@beheer');
Router::any('beheercursussen', 'Controllers\\beheer@beheerCursussen');
Router::any('beheerklanten', 'Controllers\\beheer@beheerKlanten');
Router::any('beheerboten', 'Controllers\\beheer@beheerBoten');
Router::any('beheerinstructeurs', 'Controllers\\Beheer@instructeur');
Router::any('cursistkoppelen', 'Controllers\\beheer@cursistKoppelen');
Router::any('createpdf/(:num)', 'Controllers\\beheer@createPdf');
/** Module routes. */
$hooks = Hooks::get();
$hooks->run('routes');
/** If no route found. */
示例4:
<?php
/**
* Routes - all standard routes are defined here.
*/
/** Create alias for Router. */
use Core\Router;
use Helpers\Hooks;
/** Define routes. */
Router::any('', 'Controllers\\Home@index');
Router::any('contact', 'Controllers\\Contact@index');
Router::any('portfolio', 'Controllers\\Portfolio@index');
Router::any('painel_contato_usuario', 'Controllers\\PainelContatoUsuario@ListUser');
Router::get('edit_contato_usuario/(:num)', 'Controllers\\PainelContatoUsuario@GetUser');
Router::post('edit_contato_usuario/(:num)', 'Controllers\\PainelContatoUsuario@PostUser');
Router::get('insert-blog', 'Controllers\\PainelContatoUsuario@insert');
Router::get('blog', 'Controllers\\Blog@list');
//Router::any('edit_contato_usuario/(:num)', 'Controllers\PainelContatoUsuario@EditUser');
//Router::any('edit_contato_usuario/(:num)', 'Controllers\PainelContatoUsuario@DeleteUser');
/** 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();
示例5:
* @version 2.2
* @date updated Sept 19, 2015
*/
/** Create alias for Router. */
use Core\Router;
use Helpers\Hooks;
/** Define routes. */
Router::any('', 'Controllers\\Welcome@index');
Router::any('subpage', 'Controllers\\Welcome@subPage');
Router::any('laconnexion', 'Controllers\\Connexion@connexion');
Router::any('connexion', 'Controllers\\Connexion@index');
Router::any('aide', 'Controllers\\Aide@index');
Router::any('tutorial', 'Controllers\\Tutorial@index');
Router::any('equipe', 'Controllers\\Equipe@index');
Router::any('indexScores', 'Controllers\\Scores@index');
Router::any('scores/(:any)', 'Controllers\\Scores@affichageScore');
Router::any('inscription', 'Controllers\\Connexion@indexInscription');
Router::any('linscription', 'Controllers\\Connexion@inscription');
Router::any('ladeconnexion', 'Controllers\\Connexion@deconnexion');
Router::any('indexJouer', 'Controllers\\Play@index');
Router::get('play/(:any)', 'Controllers\\Play@playLevel');
Router::post('play/incrementLevel', 'Controllers\\Connexion@incrementLevel');
/** 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();
示例6: exit
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
//initiate config
new Core\Config();
//create alias for Router
use Core\Router;
use Helpers\Hooks;
//define routes
Router::any('', 'Controllers\\Welcome@index');
Router::any('subpage', 'Controllers\\Welcome@subPage');
Router::get('something/fuck', function () {
echo 'Fuck you';
});
Router::any('hello', 'Controllers\\Hello@index');
Router::any('login', 'Controllers\\LoginController@login');
Router::any('admin', 'Controllers\\AdminController@index');
Router::any('portal', 'Controllers\\NewPortalController@index');
Router::post('logout', 'Controllers\\LogoutController@logout');
//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();
示例7:
//Создание псевдонимов для роутера
use Core\Router;
//Определение маршрутов
Router::get('', 'Controllers\\Main@index');
Router::get('register', 'Controllers\\User@register');
Router::post('register', 'Controllers\\User@createUser');
Router::get('login', 'Controllers\\User@login');
Router::post('login', 'Controllers\\User@checkUser');
Router::get('login/forgot', 'Controllers\\User@forgot');
Router::post('login/forgot', 'Controllers\\User@sendEmail');
Router::get('user', 'Controllers\\User@login');
Router::get('user/(:num)', 'Controllers\\User@index');
Router::post('user/(:num)', 'Controllers\\User@refresh');
Router::get('user/logout', 'Controllers\\User@logout');
Router::get('user/premium', 'Controllers\\User@premium');
Router::get('files', 'Controllers\\Files@index');
Router::post('files', 'Controllers\\Files@upload');
Router::get('files/(:num)', 'Controllers\\Files@file');
Router::post('files/(:num)', 'Controllers\\Files@addComment');
Router::post('files/appeal', 'Controllers\\Files@sendAppeal');
Router::get('download', 'Controllers\\Files@download');
Router::get('about', 'Controllers\\About@index');
Router::get('privacy', 'Controllers\\Privacy@index');
Router::get('terms', 'Controllers\\Terms@index');
Router::get('faq', 'Controllers\\FAQ@index');
//Если маршрут не найден
Router::error('Core\\Error@index');
//Включить старый роутинг
Router::$fallback = false;
//Запуск найденных маршрутов
Router::dispatch();
示例8:
* Routes - all standard routes are defined here.
*
* @author David Carr - dave@daveismyname.com
* @version 2.2
* @date updated Sept 19, 2015
*/
/** Create alias for Router. */
use Core\Router;
use Helpers\Hooks;
/** Define routes. */
//Welcome A MODIFFIER
Router::any('index', 'Controllers\\Welcome@index');
Router::any('subpage', 'Controllers\\Welcome@subPage');
Router::any('', 'Controllers\\Dashboard@index');
Router::any('fr/dashboard', 'Controllers\\Dashboard@index');
//Contest
Router::any('contest/index', 'Controllers\\Contest@index');
//Login routes
Router::any('apps', 'Controllers\\Login@index');
Router::get('apps/jsredirect', 'Controllers\\Login@jsRedirect');
//BackOffice
Router::any('backoffice/contest/create', 'Controllers\\backoffice\\Contest@create');
/** 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();
示例9:
<?php
use Core\Router;
Router::post('/admin/news/add', 'Controllers\\AdminController@store');
Router::get('/admin/news/add', 'Controllers\\AdminController@create');
Router::get('/admin/news/{newsId}/edit', 'Controllers\\AdminController@edit');
Router::post('/admin/news/{newsId}/delete', 'Controllers\\AdminController@delete');
Router::post('/admin/news/{newsId}/edit', 'Controllers\\AdminController@update');
Router::get('/admin/news', 'Controllers\\AdminController@news');
Router::get('/logout', 'Controllers\\AccountsController@logout');
Router::get('/subscribe', 'Controllers\\AccountsController@subscription');
Router::post('/subscribe', 'Controllers\\AccountsController@subscribe');
Router::get('/login', 'Controllers\\AccountsController@login');
Router::post('/login', 'Controllers\\AccountsController@auth');
Router::post('/{section}/{newsId}', 'Controllers\\NewsController@comment');
Router::get('/{section}/{newsId}', 'Controllers\\NewsController@news');
Router::get('/{section}', 'Controllers\\HomeController@section');
Router::get('/', 'Controllers\\HomeController@home');
示例10: dirname
<?php
// Directory separator is set up here because separators are different on Linux and Windows operating systems
define('DS', DIRECTORY_SEPARATOR);
define('ROOT_DIR', dirname(__FILE__));
define('CONF_PATH', ROOT_DIR . '/config');
define('DEVELOPMENT_ENVIRONMENT', true);
// Import Bootstrap to load configuration and requirements
require_once ROOT_DIR . '/simplex/core/Bootstrap.php';
// Call Route class via namespace
use Core\Router;
// Define your app routes here
// Example:
// To show your example page from ExampleController with access link 'yourdomain/example'
Router::get('example', 'Controllers\\ExampleController@displayExample');
// if no route found
Router::error('Core\\Error@index');
// Turn on old style routing
Router::$fallback = false;
// execute matched routes
Router::dispatch();
示例11:
* @date updated Sept 19, 2015
*/
/** Create alias for Router. */
use Core\Router;
use Helpers\Hooks;
use Helpers\User;
/** Define routes. */
if (User::current()->isAdmin()) {
Router::any('', 'Controllers\\Index@index');
} else {
Router::any('', 'Controllers\\Users@index');
}
Router::post('users', 'Controllers\\Users@create');
Router::get('users', 'Controllers\\Users@index');
Router::post('users/(:num)', 'Controllers\\Users@update');
Router::get('users/(:num)', 'Controllers\\Users@index');
Router::delete('users/(:num)', 'Controllers\\Users@delete');
Router::post('keys', 'Controllers\\Keys@create');
Router::post('keys/(:num)', 'Controllers\\Keys@update');
Router::get('keys/(:num)', 'Controllers\\Keys@index');
Router::delete('keys/(:num)', 'Controllers\\Keys@delete');
Router::get('audit', 'Controllers\\Audit@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();