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


PHP PluginBase::init方法代码示例

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


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

示例1: init

 /**
  * Overrides \Drupal\views\Plugin\views\PluginBase::init().
  *
  * The style options might come externally as the style can be sourced from at
  * least two locations. If it's not included, look on the display.
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if ($this->usesRowPlugin() && $display->getOption('row')) {
         $this->view->rowPlugin = $display->getPlugin('row');
     }
     $this->options += array('grouping' => array());
 }
开发者ID:HakS,项目名称:drupal8_training,代码行数:14,代码来源:StylePluginBase.php

示例2: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     // Check to see if this handler type is defaulted. Note that
     // we have to do a lookup because the type is singular but the
     // option is stored as the plural.
     $this->unpackOptions($this->options, $options);
     // This exist on most handlers, but not all. So they are still optional.
     if (isset($options['table'])) {
         $this->table = $options['table'];
     }
     // Allow aliases on both fields and tables.
     if (isset($this->definition['real table'])) {
         $this->table = $this->definition['real table'];
     }
     if (isset($this->definition['real field'])) {
         $this->realField = $this->definition['real field'];
     }
     if (isset($this->definition['field'])) {
         $this->realField = $this->definition['field'];
     }
     if (isset($options['field'])) {
         $this->field = $options['field'];
         if (!isset($this->realField)) {
             $this->realField = $options['field'];
         }
     }
     $this->query =& $view->query;
 }
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:32,代码来源:HandlerBase.php


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