本文整理汇总了PHP中Routes::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Routes::get方法的具体用法?PHP Routes::get怎么用?PHP Routes::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Routes
的用法示例。
在下文中一共展示了Routes::get方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: goPage
public function goPage($page)
{
/* テンプレートファイルを取得 */
$theme = Configure::read('theme');
$template_path = THEME_DIR . $theme . '/';
if (!file_exists($template_path . 'Template.php')) {
$template_path = LIB_DIR;
}
$template_class = 'Template';
if ($template_path == LIB_DIR) {
$template_class = 'TemplateBase';
}
require_once $template_path . $template_class . '.php';
/* ページを取得し、遷移する */
$page_routing = Routes::get();
$template = new $template_class($page_routing[$page]['php']);
if (isset($page_routing[$page]['js'])) {
if (is_array($page_routing[$page]['js'])) {
$template->script_src += $page_routing[$page]['js'];
} else {
$template->script_src[] = $page_routing[$page]['js'];
}
}
if (isset($page_routing[$page]['css'])) {
if (is_array($page_routing[$page]['css'])) {
$template->style_src += $page_routing[$page]['css'];
} else {
$template->style_src[] = $page_routing[$page]['css'];
}
}
$template->render();
}
示例2: run
/**
* Determines the current route and runs it.
*/
public static function run()
{
// Pull the current path out of the get arguments directly
$length = strlen(APP_RELATIVE_URL) == 0 ? 0 : strlen(APP_RELATIVE_URL) + 1;
$path = substr(urldecode(parse_url(filter_input(INPUT_SERVER, 'REQUEST_URI'), PHP_URL_PATH)), $length);
try {
// Get the appropriate route for the path
$route = Routes::get($path);
// If our route is null, we should 404
if ($route == null) {
header('Status: 404 Not Found', true, 404);
View::renderView('404');
return;
}
// See whther or not we have to check the token
if ($route->isTokenNeeded()) {
Auth::checkToken();
}
// Get the current path variables
self::$currentPathVariables = self::pullVariables($path, $route);
// Run the route
$route->run();
// See if the last rendered path variable needs to be set
if (View::hasRenderedView()) {
Session::set(self::LAST_RENDERED_PATH_KEY, $path);
}
} catch (Exception $ex) {
View::renderJson($ex->getMessage(), false);
exit;
}
}
示例3: init
public static function init()
{
// Carrega as variaveis de confiruracao para toda a aplicacao
Configs::load();
// Define o modulo
self::$moduleName = Routes::get('module');
// Define o controller
self::setController();
// Define o metodo
self::setMethod();
}
示例4: function
<?php
Routes::get('/', 'demo\\action\\HomeAction@main');
Routes::group(array('prefix' => '/user'), function () {
Routes::any('/info', 'demo\\action\\HomeAction@info');
});
示例5: ini
}
} else {
if ($ret) {
return self::$_uri[$keye];
} else {
echo self::$_uri[$keye];
}
}
}
public static function ini()
{
include_once "../app/Routes.php";
Routes::run();
}
public static function filter($filter, $call, $falsecall = null)
{
//if($filter=="auth") self::$_call_auth=$call;
//
self::$_filters[$filter] = $call;
if (!is_null($falsecall)) {
self::$_falsecall[$filter] = $falsecall;
}
}
public static function current()
{
return self::$current;
}
}
Routes::get(Config::get('panel.route'), function () {
Page::put('panel.index');
});
示例6: post
public static function post($uri, $callback, $subdomains = null)
{
return Routes::get($uri, $callback);
}
示例7: function
<?php
Routes::group('/dash/media', function () {
/**
* url: /dash/media/list
*
*/
Routes::get(['/list', 'name' => 'media_bundle_list'], 'Media\\Events\\Index@indexAction');
Routes::get(['/editor', 'name' => 'media_bundle_editor'], 'Media\\Events\\Index@editorAction');
});
Routes::group('/api/v1', function () {
Routes::post(['/uploaded', 'name' => 'media_upload_v1'], 'Media\\Apis\\V1\\Uploader@uploadAction')->setFormats(['json', 'php']);
});
示例8:
<?php
Routes::get("/tiga-framework", "WelcomeController@index");
示例9: foreach
//
if (isset($except)) {
$i = 0;
foreach ($all as $value) {
if (Table::contains($except, $value)) {
unset($all[$i]);
}
$i++;
}
}
//
if (isset($only)) {
foreach ($all as $key => $value) {
$ext = false;
foreach ($only as $value2) {
if ($value == $value2) {
$ext = true;
break;
}
}
if (!$ext) {
unset($all[$key]);
}
}
}
return $all;
}
}
Routes::get(Config::get('panel.route'), function () {
include Config::get('panel.folder') . '/home.php';
});
示例10:
<link href="./css/font-awesome.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="./css/jquery.gritter.css" />
<link rel="stylesheet" type="text/css" href="./css/style.css">
<link href="./css/css.min.css" rel="stylesheet">
</head>
<body>
<section id="container">
<?php
include 'left.php';
?>
<section id="main-content">
<section class="wrapper">
<div class="row">
<div class="col-lg-9 main-chart">
<?php
echo Routes::get($r);
?>
</div>
<?php
include 'right.php';
?>
</div><! --/row -->
</section>
</section>
<?php
include 'footer.php';
?>
</section>
<script src="./js/chart.min.js"></script>
<!--[if lt IE 9]>
<script src="./js/html5shiv.min.js"></script>
示例11: function
<?php
Routes::get("/tiga-framework", function () {
return Response::content("Welcome to Tiga!");
})->end();
示例12:
return <<<WELCOME
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<title>FastD Module</title>
<style>
body {
font-family: 'Source Sans Pro', sans-serif;
-webkit-font-smoothing: antialiased;
}
section {
text-align: center;
padding-top: 150px;
}
section h1 {
font-size: 32px;
}
</style>
</head>
<body>
<section>
<h1>Welcome to FastD Module Framework.</h1>
</section>
</body>
</html>
WELCOME;
}
}
Routes::get('/', '\\Welcome@welcomeAction');
示例13:
<?php
Routes::get('/login', 'DemoBundle:Events:Index@indexAction');
Routes::get('/welcome', 'DemoBundle:Events:Index@welcomeAction');