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


PHP View::loadHelper方法代码示例

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


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

示例1: _testEnabled

 private function _testEnabled($method = 'GET')
 {
     $request = new Request();
     $request->env('REQUEST_METHOD', $method);
     $request->here = '/pages/home';
     $response = new Response();
     $View = new View($request, $response);
     $View->loadHelper('ViewMemcached.ViewMemcached', ['cacheConfig' => TEST_CACHE_CONFIG]);
     $View->viewPath = 'Pages';
     $View->set('test', 'value');
     $View->render('home', 'default');
     return $View->ViewMemcached->enabled();
 }
开发者ID:chnvcode,项目名称:cakephp-viewmemcached,代码行数:13,代码来源:ViewMemcachedHelperTest.php

示例2: _getView

 /**
  * Prepares a View instance with which the given view file
  * will be rendered.
  *
  * @return View
  */
 protected function _getView()
 {
     $view = new View();
     foreach ($this->config('helpers') as $helper) {
         $view->loadHelper($helper);
     }
     return $view;
 }
开发者ID:codekanzlei,项目名称:cake-cktools,代码行数:14,代码来源:PdfGenerator.php

示例3: __get

 /**
  * Lazy loads helpers.
  *
  * @param string $name Name of the property being accessed.
  * @return \Cake\View\Helper|null Helper instance if helper with provided name exists
  */
 public function __get($name)
 {
     if (isset($this->_helperMap[$name]) && !isset($this->{$name})) {
         $config = ['enabled' => false] + (array) $this->_helperMap[$name]['config'];
         $this->{$name} = $this->_View->loadHelper($this->_helperMap[$name]['class'], $config);
         return $this->{$name};
     }
 }
开发者ID:MillHidden,项目名称:BiellesMeusiennes,代码行数:14,代码来源:Helper.php

示例4: testLoadHelperDuplicate

 /**
  * Test loading helper when duplicate.
  *
  * @return void
  */
 public function testLoadHelperDuplicate()
 {
     $View = new View();
     $this->assertNotEmpty($View->loadHelper('Html', ['foo' => 'bar']));
     try {
         $View->loadHelper('Html', ['test' => 'value']);
         $this->fail('No exception');
     } catch (\RuntimeException $e) {
         $this->assertContains('The "Html" alias has already been loaded', $e->getMessage());
     }
 }
开发者ID:neilan35,项目名称:betterwindow1,代码行数:16,代码来源:ViewTest.php

示例5: _loadHelper

 /**
  * Load view helpers by configure.
  *
  * @param View $view
  * @return void
  */
 protected static function _loadHelper(View $view)
 {
     $hooks = self::_getConfigData(Hook::HOOK_CONFIG_HELPER_KEY);
     foreach ($hooks as $helperName => $params) {
         list($controllers, $config) = self::_createParams($params);
         if (self::_inController($controllers, $view->request->param('controller'))) {
             $view->loadHelper($helperName, $config);
         }
     }
 }
开发者ID:UnionCMS,项目名称:Core,代码行数:16,代码来源:Hook.php

示例6: baseHelpers

 /**
  * Load base helpers.
  *
  * @param View $view
  */
 public static function baseHelpers(View $view)
 {
     $view->loadHelper('Html', ['className' => 'Union/Core.Html']);
     $view->loadHelper('Union/Core.Document');
     $view->loadHelper('Url', ['className' => 'Union/Core.Url']);
     $view->loadHelper('Form', ['className' => 'Union/Core.Form', 'widgets' => ['_default' => ['Union\\Core\\View\\Widget\\BasicWidget']]]);
     $view->loadHelper('Paginator', ['templates' => 'Union/Core.paginate_tpl']);
     $view->loadHelper('Union/Core.Less');
     $view->loadHelper('Union/Core.Union');
     $view->loadHelper('Union/Core.Assets');
     $view->loadHelper('Union/Core.ToolBar');
     $view->loadHelper('Union/Core.XmlForm');
     if ($view->request->param('prefix') == 'admin') {
         $view->loadHelper('Union/Core.Ace');
         $view->loadHelper('Union/Core.Admin');
         $view->helpers()->get('Paginator')->config(['templates' => 'Union/Core.paginate_tpl_admin']);
     }
 }
开发者ID:Cheren,项目名称:union,代码行数:23,代码来源:HookHelper.php


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