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


PHP Dispatcher::config方法代码示例

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


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

示例1: testPluginControllerLookupFail

 public function testPluginControllerLookupFail()
 {
     Dispatcher::config(array('classes' => array('router' => __CLASS__)));
     $this->expectException("/Controller `some_invalid_plugin.Controller` not found/");
     Dispatcher::run(new Request(array('url' => '/plugin')));
 }
开发者ID:nashadalam,项目名称:lithium,代码行数:6,代码来源:DispatcherTest.php

示例2: array

 * see the `Router` and `Route` classes.
 *
 * @see lithium\net\http\Router
 * @see lithium\net\http\Route
 */
use lithium\net\http\Router;
use lithium\core\Environment;
use lithium\action\Dispatcher;
// Set the evironment
if ($_SERVER['HTTP_HOST'] == 'li3bootstrap.dev.local' || $_SERVER['HTTP_HOST'] == 'li3bootstrap.local' || $_SERVER['HTTP_HOST'] == 'localhost') {
    Environment::set('development');
}
/**
 * Dispatcher rules to rewrite admin actions.
 */
Dispatcher::config(array('rules' => array('admin' => array('action' => 'admin_{:action}'))));
/**
 * "/admin" is the prefix for all Lithium Bootstrap admin routes.
 * Any "plugin" or library written for use with Lithium Bootstrap can utilize these routes
 * without needing to write any additional routes in most cases as this handles the basic CRUD.
 * It also handles pagination.
 *
 * Admin pages can be added to the main app's "/views/_libraries/li3b_core/pages" directory
 * and are accessible viw /admin/page/{:args}
 *
 * NOTE: li3b_core has no controller other than the pages controller. Other libraries and the
 * main application are where controllers belong. li3b_core is just the skeleton and assumes
 * no functionality. Static pages are as far as it goes.
 */
Router::connect("/admin", array('admin' => true, 'controller' => 'pages', 'action' => 'view', 'args' => array()), array('persist' => array('controller', 'admin')));
Router::connect("/admin/page/{:args}", array('admin' => true, 'controller' => 'pages', 'action' => 'view', 'args' => array()), array('persist' => array('controller', 'admin')));
开发者ID:tmaiaroto,项目名称:li3b_core,代码行数:31,代码来源:routes.php


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