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


PHP PhpRenderer::getHelperPluginManager方法代码示例

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


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

示例1: render

 /**
  * @param Message $message
  * @return Message
  */
 public function render(Message $message)
 {
     $viewModel = new ViewModel($this->variables);
     $viewModel->setTemplate($this->template);
     $helperPluginManager = $this->renderer->getHelperPluginManager();
     /** @var HeadTitle $helper */
     $helper = $helperPluginManager->get('HeadTitle');
     // replace headTitle
     $headTitle = new HeadTitle();
     $headTitle->setAutoEscape(false);
     $helperPluginManager->setAllowOverride(true);
     $helperPluginManager->setService('HeadTitle', $headTitle);
     if (!$message->getBody()) {
         $message->setBody(new MimeMessage());
     }
     $text = new Part($this->renderer->render($viewModel));
     $text->charset = 'UTF-8';
     $text->boundary = $message->getBody()->getMime()->boundary();
     $text->encoding = Mime::ENCODING_BASE64;
     $text->type = Mime::TYPE_HTML;
     $message->getBody()->addPart($text);
     $message->setSubject($headTitle->renderTitle());
     // hack for ZF
     $message->setBody($message->getBody());
     // restore original helper
     $helperPluginManager->setService('HeadTitle', $helper);
     return $message;
 }
开发者ID:enlitepro,项目名称:enlite-mail,代码行数:32,代码来源:Template.php

示例2: setUp

 protected function setUp()
 {
     $this->view = new PhpRenderer();
     $this->view->getHelperPluginManager()->get('basePath')->setBasePath('/');
     $this->helper = new Resize();
     $this->helper->setView($this->view);
 }
开发者ID:tck,项目名称:zf2-imageresizer,代码行数:7,代码来源:ResizeTest.php

示例3: getRenderer

 /**
  * 
  * @return \Zend\View\Renderer\PhpRenderer
  */
 public function getRenderer()
 {
     if ($this->renderer === null) {
         $renderer = new PhpRenderer();
         // register view helpers
         $formHelperConfig = new ZendFormHelperConfig();
         $formHelperConfig->configureServiceManager($renderer->getHelperPluginManager());
         // register view helpers
         $formHelperConfig = new FormHelperConfig();
         $formHelperConfig->configureServiceManager($renderer->getHelperPluginManager());
         // set base path
         $path = $this->templatePath ?: __DIR__ . '/view/scripts';
         $renderer->resolver()->addPath($path);
         $this->setRenderer($renderer);
     }
     return $this->renderer;
 }
开发者ID:rb-cohen,项目名称:jzform,代码行数:21,代码来源:RenderAbstract.php

示例4: testEvents

 public function testEvents()
 {
     $application = $this->services->get('application');
     $application->bootstrap();
     $events = new Events();
     $renderer = new PhpRenderer();
     $renderer->getHelperPluginManager()->setServiceLocator($this->services);
     $events->setView($renderer);
     $eventManager = $application->getEventManager();
     $events($eventManager);
 }
开发者ID:sporkcode,项目名称:sporktools,代码行数:11,代码来源:EventsTest.php

示例5: getHTML

 public function getHTML()
 {
     $this->checkForGetHTMLZendDependencies();
     $html = null;
     $renderer = new PhpRenderer();
     $formHelperConfig = new \Zend\Form\View\HelperConfig();
     $formHelperConfig->configureServiceManager($renderer->getHelperPluginManager());
     $formRenderer = new \Zend\Form\View\Helper\Form();
     $html .= $formRenderer->openTag($this->form);
     $formRow = new \Zend\Form\View\Helper\FormRow();
     $formRow->setView($renderer);
     foreach ($this->form->getElements() as $key => $element) {
         $html .= '<div id="' . $key . '" class="element">';
         $html .= $formRow->render($element);
         $html .= '</div>' . PHP_EOL;
     }
     $html .= $formRenderer->closeTag();
     return $html;
 }
开发者ID:caseypage,项目名称:php-ssrs-1,代码行数:19,代码来源:ZendFramework2.php

示例6: loadControler

 public static function loadControler($template)
 {
     global $view;
     $template_name = ucfirst(str_replace('.php', '', basename($template)));
     $template_name = ucwords(str_replace('-', ' ', $template_name));
     $template_name = str_replace(' ', '', $template_name);
     $controller_name = 'Bundle\\FrontBundle\\Controller\\' . $template_name . 'Controller';
     $render = new PhpRenderer();
     $plugins = $render->getHelperPluginManager();
     $config = new HelperConfig();
     $config->configureServiceManager($plugins);
     if (class_exists($controller_name)) {
         $controller = new $controller_name();
         $vars = $controller->init();
         $vars['render'] = $render;
         $view = new ViewModel($vars);
     }
     return $template;
 }
开发者ID:opsone,项目名称:wordpress-theme-kit-lib,代码行数:19,代码来源:Hook.php

示例7: initRenderer

 /**
  * Init renderer object
  */
 protected function initRenderer()
 {
     $renderer = new PhpRenderer();
     $plugins = $renderer->getHelperPluginManager();
     $config = new \Zend\Form\View\HelperConfig();
     $config->configureServiceManager($plugins);
     $resolver = new Resolver\AggregateResolver();
     $map = new Resolver\TemplateMapResolver($this->getTable()->getOptions()->getTemplateMap());
     $resolver->attach($map);
     $renderer->setResolver($resolver);
     $this->renderer = $renderer;
 }
开发者ID:kdrezo,项目名称:ZfTable,代码行数:15,代码来源:Render.php


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