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


PHP Helper::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Class Constructor
  *
  * Merges defaults with
  * - Configure::read(Meta)
  * - Helper options
  * - viewVars _meta
  * in that order (the latter trumps)
  *
  * @param array $options
  */
 public function __construct(View $View, $options = [])
 {
     parent::__construct($View, $options);
     $configureMeta = (array) Configure::read('Meta');
     if (Configure::read('Meta.robots') && is_array(Configure::read('Meta.robots'))) {
         $configureMeta['robots'] = Hash::merge($this->meta['robots'], Configure::read('Meta.robots'));
     }
     $this->meta = $configureMeta + $this->meta;
     if (!empty($options['robots']) && is_array($options['robots'])) {
         $options['robots'] = Hash::merge($this->meta['robots'], $options['robots']);
     }
     $this->meta = $options + $this->meta;
     if (!empty($this->_View->viewVars['_meta'])) {
         $viewVarsMeta = (array) $this->_View->viewVars['_meta'];
         if (!empty($viewVarsMeta['robots']) && is_array($viewVarsMeta['robots'])) {
             $viewVarsMeta['robots'] = Hash::merge($this->meta['robots'], $viewVarsMeta['robots']);
         }
         $this->meta = $viewVarsMeta + $this->meta;
     }
     if ($this->meta['charset'] === null) {
         // By default include this
         $this->meta['charset'] = true;
     }
     if ($this->meta['icon'] === null) {
         // By default include this
         $this->meta['icon'] = true;
     }
     if ($this->meta['title'] === null) {
         $this->meta['title'] = __(Inflector::humanize(Inflector::underscore($this->request->params['controller']))) . ' - ' . __(Inflector::humanize(Inflector::underscore($this->request->params['action'])));
     }
 }
开发者ID:dereuromark,项目名称:cakephp-meta,代码行数:42,代码来源:MetaHelper.php

示例2: __construct

 /**
  * __construct callback
  *
  * @param \Cake\View\View $View : View
  * @param array $config : Config
  * @throws Cake\Error\NotFoundException
  */
 public function __construct(\Cake\View\View $View, array $config = [])
 {
     parent::__construct($View, $config);
     if (!$this->_isSupportedFramework($fw = $this->config('assets.framework'))) {
         throw new NotFoundException(sprintf(__d('bootstrap', 'Configured JavaScript framework "{0}" is not supported. Only "{1}" are valid options.', $fw, implode(', ', $this->_authorizedJsLibs))));
     }
 }
开发者ID:cake17,项目名称:cakephp-bootstrap,代码行数:14,代码来源:BsSliderHelper.php

示例3: __construct

 /**
  * Constructor. Overridden to merge passed args with URL options.
  *
  * @param \Cake\View\View $View The View this helper is being attached to.
  * @param array $config Configuration settings for the helper.
  */
 public function __construct(View $View, array $config = [])
 {
     parent::__construct($View, $config);
     $query = $this->request->query;
     unset($query['page'], $query['limit'], $query['sort'], $query['direction']);
     $this->config('options.url', array_merge($this->request->params['pass'], ['?' => $query]));
 }
开发者ID:rlugojr,项目名称:cakephp,代码行数:13,代码来源:PaginatorHelper.php

示例4: __construct

 /**
  * Constructor
  *
  * @param \Cake\View\View $View The View this helper is being attached to.
  * @param array $config Configuration settings for the helper.
  */
 public function __construct(View $View, array $config = [])
 {
     $defaults = (array) Configure::read('Highlighter');
     parent::__construct($View, $config + $defaults);
     if ($this->_config['debug'] === null) {
         $this->_config['debug'] = Configure::read('debug');
     }
 }
开发者ID:dereuromark,项目名称:cakephp-markup,代码行数:14,代码来源:HighlighterHelper.php

示例5: __construct

 /**
  * Initializes Lessc and cleans less and css paths
  *
  * {@inheritdoc}
  */
 public function __construct(View $View, array $config = [])
 {
     parent::__construct($View, $config);
     // Initialize oyejorge/less.php parser
     require_once ROOT . DS . 'vendor' . DS . 'oyejorge' . DS . 'less.php' . DS . 'lib' . DS . 'Less' . DS . 'Autoloader.php';
     \Less_Autoloader::register();
     $this->css_path = WWW_ROOT . trim($this->css_path, '/');
 }
开发者ID:eddiePower,项目名称:cakephp,代码行数:13,代码来源:LessHelper.php

示例6: __construct

 /**
  * Constructor - finds and parses the ini file the plugin uses.
  *
  * @param \Cake\View\View $view The view instance to use.
  * @param array $settings The settings for the helper.
  * @return void
  */
 public function __construct(View $view, $settings = [])
 {
     parent::__construct($view, $settings);
     if (empty($settings['noconfig'])) {
         $configFinder = new ConfigFinder();
         $this->assetConfig($configFinder->loadAll());
     }
 }
开发者ID:clthck,项目名称:asset-compress-improved,代码行数:15,代码来源:AssetCompressHelper.php

示例7: __construct

 public function __construct(View $view, $config = [])
 {
     parent::__construct($view, $config);
     $this->_configs = $this->config();
     $this->appId = $this->_configs['app_id'];
     $this->redirectUrl = $this->_configs['redirect_url'];
     $this->appScope = $this->_configs['app_scope'];
 }
开发者ID:nanexcool,项目名称:AKKA-CakePHP-Facebook-Plugin,代码行数:8,代码来源:FacebookHelper.php

示例8: __construct

 /**
  * Construct method.
  *
  * @param \Cake\View\View $view The view that was fired.
  * @param array $config The config passed to the class.
  */
 public function __construct(View $view, $config = [])
 {
     parent::__construct($view, $config);
     $collection = new ComponentRegistry();
     $this->Acl = new AclComponent($collection);
     $this->Authorize = new ActionsAuthorize($collection);
     $this->Authorize->config($this->config());
 }
开发者ID:Xety,项目名称:Xeta,代码行数:14,代码来源:AclHelper.php

示例9: __construct

 /**
  * Constructor
  * @param View $View
  * @param unknown $settings
  */
 public function __construct(View $View, array $config = [])
 {
     // call parent constructor
     parent::__construct($View, $config);
     // calculate file system route
     $this->_config['css']['route'] = rtrim(WWW_ROOT, DS) . str_replace('/', DS, $this->_config['css']['path']);
     $this->_config['js']['route'] = rtrim(WWW_ROOT, DS) . str_replace('/', DS, $this->_config['js']['path']);
 }
开发者ID:unimatrix,项目名称:cakephp-utility,代码行数:13,代码来源:MinifyHelper.php

示例10: __construct

 public function __construct(View $View, array $config = [])
 {
     $this->_defaultConfig['url'] = $View->request->here;
     parent::__construct($View, $config);
     $this->setCard($this->config('card'));
     $this->setUrl($this->config('url'));
     $this->setTitle($View->fetch('title'));
 }
开发者ID:antevertonlima,项目名称:social-meta,代码行数:8,代码来源:CardHelper.php

示例11: __construct

 public function __construct(View $View, array $config = [])
 {
     $defaults = (array) Configure::read('Format') + $this->_defaults;
     $config += $defaults;
     $config['fontIcons'] = (array) $config['fontIcons'] + $this->_defaultIcons;
     $this->template = new StringTemplate($config['templates']);
     parent::__construct($View, $config);
 }
开发者ID:ayman-alkom,项目名称:cakephp-tools,代码行数:8,代码来源:FormatHelper.php

示例12: __construct

 /**
  * Construct method.
  *
  * @param \Cake\View\View $view The view that was fired.
  * @param array $config The config passed to the class.
  */
 public function __construct(View $view, $config = [])
 {
     parent::__construct($view, $config);
     $collection = new ComponentRegistry();
     $this->Acl = new AclComponent($collection);
     $this->Authorize = new ActionsAuthorize($collection);
     $this->Authorize->config(['actionPath' => 'app/', 'userModel' => 'Users']);
 }
开发者ID:edukondaluetg,项目名称:Xeta,代码行数:14,代码来源:AclHelper.php

示例13: __construct

 /**
  * Constructor
  *
  * @param View $View
  * @param array $config
  */
 public function __construct(View $View, array $config = array())
 {
     parent::__construct($View, $config);
     if (isset($config['dateformat'])) {
         $this->__dateformat = $config['dateformat'];
     } else {
         $this->__dateformat = Configure::read('excel.dateformat');
     }
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:15,代码来源:ExcelHelper.php

示例14: __construct

 /**
  * Construct, optionally with GeshiHelper for code highlighting
  * 
  * @param \Cake\View\View $View
  * @param array $config
  */
 public function __construct(View $View, array $config = array())
 {
     $config += $this->defaultConfig;
     $this->helpers += (array) $config['helpers'];
     parent::__construct($View, $config);
     if (!is_object($this->Geshi)) {
         $this->Geshi = FALSE;
     }
 }
开发者ID:OrigamiStructures,项目名称:Cake3xMarkdown,代码行数:15,代码来源:CakeMarkdownHelper.php

示例15: __construct

 /**
  * Constructor. Overridden to merge passed args with URL options.
  *
  * @param \Cake\View\View $View The View this helper is being attached to.
  * @param array $config Configuration settings for the helper.
  */
 public function __construct(\Cake\View\View $View, array $config = [])
 {
     // Amazon S3 config
     $config = $this->config();
     $credentials = new Credentials($config['S3Key'], $config['S3Secret']);
     $options = ['region' => $config['S3Region'], 'version' => $config['S3Version'], 'http' => ['verify' => false], 'signature_version' => $config['S3SignatureVersion'], 'credentials' => $credentials];
     $this->_s3Client = new S3Client($options);
     parent::__construct($View, $config + ['helpers' => ['Html']]);
 }
开发者ID:EnterpriseConsultingDeveloper,项目名称:cakephp-utils,代码行数:15,代码来源:S3FileHelper.php


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