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


PHP router::run方法代码示例

本文整理汇总了PHP中router::run方法的典型用法代码示例。如果您正苦于以下问题:PHP router::run方法的具体用法?PHP router::run怎么用?PHP router::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在router的用法示例。


在下文中一共展示了router::run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     safe::safeGPC();
     if (router::run()) {
         return;
     }
     $controller = isset($_GET['c']) ? "{$_GET['c']}Controller" : 'indexController';
     $action = isset($_GET['a']) ? "{$_GET['a']}Action" : 'indexAction';
     if (method_exists($controller, $action)) {
         $controller = new $controller();
         call_user_func(array($controller, $action));
     } else {
         self::error('Action不存在!', "c={$controller} a={$action} 未定义!");
         self::_exit();
     }
 }
开发者ID:baitongda,项目名称:mPHP,代码行数:16,代码来源:mPHP.php

示例2: testRun

 /**
  * 
  * @dataProvider urlProvider
  */
 public function testRun($url, $expected)
 {
     $_SERVER['REQUEST_URI'] = $url;
     router::run();
     $this->expectOutputString($expected);
 }
开发者ID:rolisz,项目名称:framework,代码行数:10,代码来源:routerTest.php

示例3: run

 /**
  * @see router::run
  */
 public static function run()
 {
     if (!class_exists('router', FALSE)) {
         include_once 'router.php';
     }
     router::run();
 }
开发者ID:rolisz,项目名称:framework,代码行数:10,代码来源:rolisz.php

示例4:

<?php

/**
 * The local of this file is setted in the config file
 * This file can run route matches or can include another route file
 * For example i can run a route inside my app or inside packages
 */
//Run routing from app without prefix
//init the closure with the prefix fa
//This code is needed and you should not delete or modify
router::run('/app/' . APP_NAME . '/routing.php', '', $router);
//all the routes that run in this file are the routes that will be needed for all apps
//for routes that only are used by one specific app must be declared in the routing file inside the app
//Why this file exists? I think most of the routes are app specific...
//This file exist because the goal is multiapp framework, because of that i think a nice approach would be for example use the same backoffice for all apps
//in this case of the backoffice the routes for the backoffice are inserted in this file
// you cant run routes from multiple apps from one app, this is not permited and only makes the code confuse
// if you need to access stuff from another app then that stuff is aproved to be a package
// in the app i canot access another apps
// in the app i have full access to packages
router::runpackage('moonlight/auth', '', $router);
router::runpackage('moonlight/backoffice', 'bo', $router);
开发者ID:tandrezone,项目名称:myframework,代码行数:22,代码来源:routing.php


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