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


PHP Router::plugin方法代码示例

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


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

示例1: setUp

 /**
  * Setup method.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Router::plugin('DebugKit', function ($routes) {
         $routes->connect('/toolbar/:action/*', ['controller' => 'Requests']);
     });
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:12,代码来源:RequestsControllerTest.php

示例2: setUp

 /**
  * reset environment.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('App.namespace', 'TestApp');
     Plugin::load(array('TestPlugin', 'TestPluginTwo'));
     $this->Case = $this->getMockForAbstractClass('Cake\\TestSuite\\ControllerTestCase');
     $this->Case->loadRoutes = false;
     DispatcherFactory::add('Routing');
     DispatcherFactory::add('ControllerFactory');
     Router::scope('/', function ($routes) {
         $routes->fallbacks();
     });
     Router::prefix('admin', function ($routes) {
         $routes->plugin('TestPlugin', function ($routes) {
             $routes->fallbacks();
         });
         $routes->fallbacks();
     });
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks();
     });
     Router::plugin('TestPluginTwo', function ($routes) {
         $routes->fallbacks();
     });
     TableRegistry::clear();
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:31,代码来源:ControllerTestCaseTest.php

示例3: setUp

 /**
  * Setup method.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Router::plugin('DebugKit', function ($routes) {
         $routes->connect('/toolbar/clear_cache/*', ['plugin' => 'DebugKit', 'controller' => 'Toolbar', 'action' => 'clearCache']);
     });
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:12,代码来源:ToolbarControllerTest.php

示例4: testBuildResetWithPlugin

 /**
  * @return void
  */
 public function testBuildResetWithPlugin()
 {
     Router::connect('/:controller/:action/*');
     $result = $this->Url->buildReset(['controller' => 'foobar', 'action' => 'test']);
     $expected = '/foobar/test';
     $this->assertSame($expected, $result);
     $this->Url->request->here = '/admin/foo/bar/baz/test';
     $this->Url->request->params['prefix'] = 'admin';
     $this->Url->request->params['plugin'] = 'Foo';
     Router::reload();
     Router::connect('/:controller/:action/*');
     Router::plugin('Foo', function ($routes) {
         $routes->fallbacks();
     });
     Router::prefix('admin', function ($routes) {
         $routes->plugin('Foo', function ($routes) {
             $routes->fallbacks();
         });
     });
     Plugin::routes();
     Router::pushRequest($this->Url->request);
     $result = $this->Url->build(['controller' => 'bar', 'action' => 'baz', 'x']);
     $expected = '/admin/foo/bar/baz/x';
     $this->assertSame($expected, $result);
     $result = $this->Url->buildReset(['controller' => 'bar', 'action' => 'baz', 'x']);
     $expected = '/bar/baz/x';
     $this->assertSame($expected, $result);
 }
开发者ID:dereuromark,项目名称:cakephp-tools,代码行数:31,代码来源:UrlHelperTest.php

示例5: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     Plugin::load('TestPlugin', ['autoload' => true]);
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     Plugin::load('Union/Core', ['path' => ROOT, 'routes' => true, 'bootstrap' => true]);
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:13,代码来源:AppViewIntegrationTest.php

示例6: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Plugin::load('Union/Core', ['path' => ROOT, 'routes' => true, 'bootstrap' => true]);
     Plugin::load('TestPlugin');
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     $this->View = $this->getMock('Union\\Core\\View\\AppView', ['append']);
     $this->Button = new ButtonHelper($this->View);
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:16,代码来源:ButtonHelperTest.php

示例7: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Plugin::load('TestPlugin', ['autoload' => true]);
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     $this->Controller = new AppController(new Request(['session' => new Session()]));
     $componentRegistry = new ComponentRegistry($this->Controller);
     $this->App = new AppComponent($componentRegistry);
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:16,代码来源:AppComponentTest.php

示例8: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Plugin::load('TestPlugin');
     Plugin::load('Union/Core', ['path' => ROOT]);
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     $this->View = new AppView();
     $this->Html = new HtmlHelper($this->View);
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:16,代码来源:HtmlHelperTest.php

示例9: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Plugin::load('Union/Core', ['path' => ROOT, 'routes' => true, 'bootstrap' => true]);
     Plugin::load('TestPlugin');
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     $this->View = new AppView();
     $this->Form = new FormHelper($this->View, ['widgets' => ['_default' => 'Union\\Core\\View\\Widget\\BasicWidget', 'button' => 'Union\\Core\\View\\Widget\\ButtonWidget', 'textarea' => 'Union\\Core\\View\\Widget\\TextAreaWidget'], 'templates' => 'Union/Core.templates/form']);
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:16,代码来源:FormHelperTest.php

示例10: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Plugin::load('Union/Core', ['path' => ROOT, 'routes' => true, 'bootstrap' => true]);
     Plugin::load('TestPlugin');
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     $Request = new Request(['params' => ['plugin' => 'TestPlugin', 'controller' => 'Event', 'action' => 'view', 'pass' => []]]);
     $this->View = new AppView($Request);
     $this->ToolBar = new ToolBarHelper($this->View);
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:17,代码来源:ToolBarHelperTest.php

示例11: setUp

 /**
  * Setup test data.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Plugin::load('Union/Core', ['path' => ROOT, 'routes' => true, 'bootstrap' => true]);
     Plugin::load('TestPlugin', ['autoload' => true]);
     Router::plugin('TestPlugin', function ($routes) {
         $routes->fallbacks('DashedRoute');
     });
     Router::plugin('TestPlugin', ['path' => '/'], function (RouteBuilder $routeBuilder) {
         $routeBuilder->prefix('admin', function (RouteBuilder $routeBuilder) {
             $routeBuilder->connect('/:plugin/:controller/:action/*', []);
         });
     });
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:19,代码来源:ProcessComponentTest.php

示例12: function

<?php

/**
 * HybridAuth Plugin routes
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 */
namespace ADmad\HybridAuth\Config;

use Cake\Routing\Router;
Router::plugin('ADmad/HybridAuth', ['path' => '/hybrid_auth'], function ($routes) {
    $routes->connect('/endpoint', ['controller' => 'HybridAuth', 'action' => 'endpoint']);
    $routes->connect('/authenticated', ['controller' => 'HybridAuth', 'action' => 'authenticated']);
});
开发者ID:jamiefifty,项目名称:CakePHP-HybridAuth,代码行数:15,代码来源:routes.php

示例13: function

<?php

use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
Router::plugin('Pie/Users', ['path' => '/users'], function (RouteBuilder $routes) {
    $routes->fallbacks('DashedRoute');
});
开发者ID:phpie,项目名称:users-plugin,代码行数:7,代码来源:routes.php

示例14: function

/**
 * Adding routes for the api-prefix and CakeManager-Plugin
 */
Router::prefix('api', function ($routes) {
    $routes->plugin('CakeManager', ['path' => '/'], function ($routes) {
        $routes->extensions(['json']);
        $routes->resources('Roles');
        $routes->resources('Users');
        $routes->fallbacks('InflectedRoute');
    });
});
/*
 * Adding default routes for the CakeManager
 */
Router::plugin('CakeManager', ['path' => '/'], function ($routes) {
    $routes->fallbacks('InflectedRoute');
});
/**
 * Default routes for usersController from the CakeManager
 *
 * Previous:
 * manager/users/request
 *
 * New:
 * users/request
 *
 */
Router::connect('/users/:action/*', ['plugin' => 'CakeManager', 'prefix' => false, 'controller' => 'Users']);
/**
 * Default login-url
 */
开发者ID:Adnan0703,项目名称:cakephp-cakemanager,代码行数:31,代码来源:routes.php

示例15: function

<?php

use Cake\Routing\Router;
Router::extensions(['xlsx']);
Router::plugin('Cewi/Excel', null, function ($routes) {
    $routes->connect('/:controller/:action');
});
开发者ID:rashmi,项目名称:newrepo,代码行数:7,代码来源:routes.php


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