当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::route方法代码示例

本文整理汇总了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);
 }
开发者ID:hugoabonizio,项目名称:BirdsPHP,代码行数:12,代码来源:initializer.php

示例2: Application

<?php

include __DIR__ . "/../core/init.php";
include __DIR__ . "/../lib/index.php";
$application = new Application();
$application->route();
开发者ID:guadin,项目名称:pylon,代码行数:6,代码来源:index.php

示例3: Application

<?php

define('DACCESS', 1);
require 'framework.php';
$app = new Application();
$app->route();
$app->dispatch();
$app->render();
开发者ID:walney,项目名称:SlaveFramework,代码行数:8,代码来源:index.php

示例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);
开发者ID:RomsonApp,项目名称:blog,代码行数:10,代码来源:index.php

示例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));
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:12,代码来源:Redirect.php

示例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);
 }
开发者ID:nkammah,项目名称:Crash-Analytics,代码行数:11,代码来源:Url.php

示例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');
开发者ID:natewilliford,项目名称:cmsexp,代码行数:30,代码来源:index.php


注:本文中的Application::route方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。