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


PHP Dispatcher::setActionName方法代码示例

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


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

示例1: setUpDispatcher

 private function setUpDispatcher()
 {
     $this->dispatcher->setControllerName($this->router->getControllerName());
     $this->dispatcher->setActionName($this->router->getActionName());
     $this->dispatcher->setParams($this->router->getParams());
     $oDispatcherEventManager = new Manager();
     $oDispatcherEventManager->attach('dispatch:beforeDispatch', function (Event $oEvent, Dispatcher $oDispatcher, $data) {
         return false;
     });
     $this->dispatcher->setEventsManager($oDispatcherEventManager);
 }
开发者ID:rcmonitor,项目名称:abboom_phalcon_code_example,代码行数:11,代码来源:DefaultDispatcherTest.php

示例2: setActionName

 public function setActionName($actionName)
 {
     /** @var \Phalcon\Http\Request $request */
     $request = $this->getDI()->get('request');
     $actionName = strtolower($request->getMethod());
     parent::setActionName($actionName);
 }
开发者ID:dubhunter,项目名称:talon,代码行数:7,代码来源:RestDispatcher.php

示例3: setUp

 /**
  * Sets the test up by loading the DI container and other stuff
  *
  * @return Phalcon\DI
  */
 protected function setUp()
 {
     parent::setUp();
     // Set the dispatcher
     $this->di->set('dispatcher', function () {
         $dispatcher = new PhDispatcher();
         $dispatcher->setControllerName('test');
         $dispatcher->setActionName('empty');
         $dispatcher->setParams(array());
         return $dispatcher;
     });
     $this->di->set('escaper', function () {
         return new PhEscaper();
     });
 }
开发者ID:starsw001,项目名称:cphalcon,代码行数:20,代码来源:FunctionalTestCase.php

示例4: setUp

 /**
  * Sets the test up by loading the DI container and other stuff
  *
  * @param  \Phalcon\DiInterface $di
  * @param  \Phalcon\Config      $config
  * @return void
  */
 protected function setUp(\Phalcon\DiInterface $di = null, \Phalcon\Config $config = null)
 {
     parent::setUp($di, $config);
     // Set the dispatcher
     $this->di->setShared('dispatcher', function () {
         $dispatcher = new PhDispatcher();
         $dispatcher->setControllerName('test');
         $dispatcher->setActionName('empty');
         $dispatcher->setParams(array());
         return $dispatcher;
     });
     $this->di->set('escaper', function () {
         return new PhEscaper();
     });
     if ($this->di instanceof \Phalcon\DiInterface) {
         $this->application = new PhApplication($this->di);
     }
 }
开发者ID:nejtr0n,项目名称:incubator,代码行数:25,代码来源:FunctionalTestCase.php

示例5: setUp

 /**
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     // Set the dispatcher
     $this->di->setShared('dispatcher', function () {
         $dispatcher = new PhDispatcher();
         $dispatcher->setControllerName('test');
         $dispatcher->setActionName('empty');
         $dispatcher->setParams([]);
         return $dispatcher;
     });
     $this->di->set('escaper', function () {
         return new PhEscaper();
     });
     if ($this->di instanceof DiInterface) {
         $this->application = new PhApplication($this->di);
     }
 }
开发者ID:lisong,项目名称:incubator,代码行数:21,代码来源:FunctionalTestCase.php

示例6: beforeDispatch

 /**
  * This action is executed before execute any action in the application
  */
 public function beforeDispatch(Event $event, Dispatcher $dispatcher)
 {
     $role = $this->getActiveRole();
     $allowed = $this->getAcl()->isAllowed($role, $dispatcher->getControllerName(), $dispatcher->getActionName());
     if ($allowed != Acl::ALLOW) {
         $this->flash->error("No Tienes acceso a este Modulo " . $dispatcher->getActionName() . " on " . $dispatcher->getModuleName() . " module");
         /*
         $dispatcher->forward(
             array(
                 'controller' => 'index',
                 'action'     => 'index'
             )
         );
         */
         $dispatcher->setActionName('nonexistaction');
         header('location:/401');
     }
 }
开发者ID:Jonhathan-Rodas,项目名称:elephant,代码行数:21,代码来源:Security.php

示例7: Router

<?php

/**
 * Created by PhpStorm.
 * User: rcmonitor
 * Date: 07.07.15
 * Time: 15:46
 */
use Phalcon\Di;
use Phalcon\Events\Manager;
use Phalcon\Mvc\Dispatcher;
use Phalcon\Mvc\Router;
use Phalcon\Version;
$di = new Di\FactoryDefault();
$oRouter = new Router(false);
$oRouter->setDI($di);
$oRouter->add('/:controller', array('controller' => 1, 'action' => 'index'));
$oEventManager = new Manager();
$oEventManager->attach('dispatch:beforeDispatch', function () {
    return false;
});
$oDispatcher = new Dispatcher();
$oDispatcher->setDI($di);
$oDispatcher->setEventsManager($oEventManager);
$oRouter->handle('/test');
$oDispatcher->setControllerName($oRouter->getControllerName());
$oDispatcher->setActionName($oRouter->getActionName());
$oDispatcher->dispatch();
echo $oDispatcher->getControllerClass() . PHP_EOL;
echo Version::get() . PHP_EOL;
开发者ID:rcmonitor,项目名称:abboom_phalcon_code_example,代码行数:30,代码来源:discussion.php


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