本文整理汇总了PHP中Application::route方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::route方法的具体用法?PHP Application::route怎么用?PHP Application::route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::route方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run($uri, $method)
{
$url_prefix = \Framework\Application::$url_prefix;
if (substr($uri, 0, strlen($url_prefix)) == $url_prefix) {
$uri = substr($uri, strlen($url_prefix));
}
$path = strtok($uri, '?');
if ($path[0] != '/') {
$path = '/' . $path;
}
parent::route($method, $path);
}
示例2: Application
<?php
include __DIR__ . "/../core/init.php";
include __DIR__ . "/../lib/index.php";
$application = new Application();
$application->route();
示例3: Application
<?php
define('DACCESS', 1);
require 'framework.php';
$app = new Application();
$app->route();
$app->dispatch();
$app->render();
示例4: Application
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . "/vendor/autoload.php";
$config = (require __DIR__ . '/application/config/main.php');
$app = new Application();
$app->merge($config);
$app->route()->get($_GET);
示例5: link
/**
* Redirect user the the given link under the same domain.
*
* @param string $path
* @return \Koldy\Redirect
* @link http://koldy.net/docs/redirect#usage
* @link http://koldy.net/docs/url#link
*/
public static function link($path)
{
return self::temporary(Application::route()->link($path));
}
示例6: cdn
/**
* Generate URL for asset file depending on configuration for assets located in configs/application.php 'cdn_url'.
* This method is using cdn() method in routing class, so be careful because it might be overriden in your case.
*
* @param string $path
* @return string
*/
public static function cdn($path)
{
return Application::route()->cdn($path);
}
示例7:
//print_r($_SERVER); exit;
require_once '../Bootstrap.php';
Config::setDocumentRoot('/Users/nathan/Projects/Sites/cmsexp');
//class MyHook implements Application_Hook {
//
// public function preDispatch() {
// print_r('pre dispatch'); exit;
// }
//
// public function postDispatch() {
//
// }
//}
//Application::setHookListenner(new MyHook());
Application::route($_SERVER['REQUEST_URI']);
//
//$type = Content_Type::create('page');
//$type->addField('title');
//$type->addField('body');
//$type->save();
//$type = Content_Type::getByName('post');
//$type = Content_Type::getOne('4e1e099833f1f74a22000000');
//$type->delete(); exit;
//$type->removeField('author');
//print_r($type); exit;
//$content = Content::create('post', array('title' => 'This is a test post', 'body' => 'Lorem ipsum dolor', 'someotherfield' => 'derp2'));
//$content = Content::getOne('post', '4e345b5833f1f7f11d020000');
//print_r($content); exit;
//echo Content::getOne('post', '4e34596833f1f7f51d010000')->render(); exit;
//$page = new Page('main');