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


PHP PluginManager::getController方法代码示例

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


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

示例1: __invoke

 /**
  * {@inheritdoc}
  *
  * @param PluginManager $pluginManager
  *
  * @return InitMetaTags
  */
 public function __invoke(PluginManager $pluginManager)
 {
     /* @var \Zend\ServiceManager\ServiceManager */
     $viewHelper = $pluginManager->getController()->getServiceLocator()->get('ViewHelperManager');
     /*
      * @var \Zend\View\Helper\Placeholder\Container
      */
     $placeholderContainer = $viewHelper->get('placeholder')->getContainer('customHead');
     /*
      * @var \Zend\View\Helper\HeadMeta
      */
     $headMeta = $viewHelper->get('HeadMeta');
     /*
      * @var \Zend\Http\PhpEnvironment\Request
      */
     $request = $pluginManager->getController()->getRequest();
     /*
      * @var \SD\Application\Controller\Plugin\SystemSettings
      */
     $systemSettings = $pluginManager->get('systemsettings');
     /*
      * @var InitMetaTags
      */
     $plugin = new InitMetaTags($placeholderContainer, $headMeta, $request, $systemSettings);
     return $plugin;
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:33,代码来源:InitMetaTagsFactory.php

示例2: __invoke

 /**
  * {@inheritdoc}
  *
  * @param PluginManager $pluginManager
  *
  * @return Translate
  */
 public function __invoke(PluginManager $pluginManager)
 {
     /* @var \Zend\ServiceManager\ServiceManager */
     $translator = $pluginManager->getController()->getServiceLocator()->get('translator')->getTranslator();
     $plugin = new Translate($translator);
     return $plugin;
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:14,代码来源:TranslateFactory.php

示例3: __invoke

 /**
  * {@inheritdoc}
  */
 public function __invoke(PluginManager $pluginManager)
 {
     /* @var Zend\ServiceManager\ServiceManager */
     $serviceLocator = $pluginManager->getController()->getServiceLocator();
     $plugin = new GetTableModel($serviceLocator);
     return $plugin;
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:10,代码来源:GetTableModelFactory.php

示例4: __invoke

 /**
  * {@inheritdoc}
  */
 public function __invoke(PluginManager $pluginManager)
 {
     $controller = $pluginManager->getController();
     $layout = $controller->layout();
     $response = $controller->getResponse();
     $plugin = new ErrorCodes($layout, $response);
     return $plugin;
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:11,代码来源:ErrorCodesFactory.php

示例5: __invoke

 /**
  * {@inheritdoc}
  *
  * @param PluginManager $pluginManager
  *
  * @return SystemSettings
  */
 public function __invoke(PluginManager $pluginManager)
 {
     /* @var \Zend\ServiceManager\ServiceLocatorInterface */
     $serviceLocator = $pluginManager->getController()->getServiceLocator();
     $config = $serviceLocator->get('Config');
     /*
      * No need to pass a second argument, just for the theme name. Instead,merge it into the already system config array
      */
     $config['system_config']['theme']['name'] = $config['theme']['name'];
     $plugin = new SystemSettings($config['system_config']);
     return $plugin;
 }
开发者ID:samsonasik,项目名称:unnamed,代码行数:19,代码来源:SystemSettingsFactory.php

示例6: testInjectingPluginManagerSetsControllerWhenPossible

 public function testInjectingPluginManagerSetsControllerWhenPossible()
 {
     $plugins = new PluginManager();
     $this->assertNull($plugins->getController());
     $this->controller->setPluginManager($plugins);
     $this->assertSame($this->controller, $plugins->getController());
     $this->assertSame($plugins, $this->controller->getPluginManager());
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:8,代码来源:ActionControllerTest.php


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