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


PHP FieldPluginBase::init方法代码示例

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


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

示例1: init

 /**
  * Override init function to provide generic option to link to shipment.
  */
 public function init(&$view, &$data)
 {
     parent::init($view, $data);
     if (!empty($this->options['link_to_shipment'])) {
         $this->additional_fields['order_id'] = array('table' => $this->table_alias, 'field' => 'order_id');
     }
 }
开发者ID:pedrocones,项目名称:hydrotools,代码行数:10,代码来源:ShipmentId.php

示例2: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($options['link_to_file'])) {
         $this->additional_fields['uri'] = 'uri';
     }
 }
开发者ID:HakS,项目名称:drupal8_training,代码行数:10,代码来源:File.php

示例3: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if ($this->options['replace_variables']) {
         $this->additional_fields['variables'] = 'variables';
     }
 }
开发者ID:sarahwillem,项目名称:OD8,代码行数:10,代码来源:DblogMessage.php

示例4: init

 /**
  * Override init function to provide generic option to link to user.
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($this->options['link_to_user'])) {
         $this->additional_fields['uid'] = array('table' => 'uc_orders', 'field' => 'uid');
     }
 }
开发者ID:pedrocones,项目名称:hydrotools,代码行数:10,代码来源:FullName.php

示例5: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $default_formats = array('yes-no' => array(t('Yes'), $this->t('No')), 'true-false' => array(t('True'), $this->t('False')), 'on-off' => array(t('On'), $this->t('Off')), 'enabled-disabled' => array(t('Enabled'), $this->t('Disabled')), 'boolean' => array(1, 0), 'unicode-yes-no' => array('✔', '✖'));
     $output_formats = isset($this->definition['output formats']) ? $this->definition['output formats'] : array();
     $custom_format = array('custom' => array(t('Custom')));
     $this->formats = array_merge($default_formats, $output_formats, $custom_format);
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:11,代码来源:Boolean.php

示例6: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     // Don't add the additional fields to groupby
     if (!empty($this->options['link_to_node'])) {
         $this->additional_fields['nid'] = array('table' => 'node_field_data', 'field' => 'nid');
     }
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:11,代码来源:Node.php

示例7: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->format = $this->definition['format'];
     $this->additional_fields = array();
     if (is_array($this->format)) {
         $this->additional_fields['format'] = $this->format;
     }
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:12,代码来源:Markup.php

示例8: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $entity_type = $this->getEntityType();
     // Filter the actions to only include those for this entity type.
     $this->actions = array_filter($this->actionStorage->loadMultiple(), function ($action) use($entity_type) {
         return $action->getType() == $entity_type;
     });
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:12,代码来源:BulkForm.php

示例9: init

 /**
  * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::init().
  *
  * Provide generic option to link to comment.
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     if (!empty($this->options['link_to_comment'])) {
         $this->additional_fields['cid'] = 'cid';
         $this->additional_fields['entity_id'] = array('table' => 'comment_field_data', 'field' => 'entity_id');
         $this->additional_fields['entity_type'] = array('table' => 'comment_field_data', 'field' => 'entity_type');
     }
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:14,代码来源:Comment.php

示例10: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     // Don't add the additional fields to groupby
     if (!empty($this->options['link_to_feed'])) {
         $this->additional_fields['fid'] = array('table' => 'feeds_feed', 'field' => 'fid');
         if (module_exists('translation')) {
             $this->additional_fields['langcode'] = array('table' => 'feeds_feed', 'field' => 'langcode');
         }
     }
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:14,代码来源:Feed.php

示例11: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->additional_fields[$this->definition['entity type field']] = $this->definition['entity type field'];
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:8,代码来源:EntityLabel.php

示例12: init

 /**
  * Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->additional_fields['tid'] = 'tid';
     $this->additional_fields['vid'] = 'vid';
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:9,代码来源:LinkEdit.php

示例13: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
     $this->multiple = FALSE;
     $this->limit_values = FALSE;
     $field_definition = $this->getFieldDefinition();
     $cardinality = $field_definition->getFieldStorageDefinition()->getCardinality();
     if ($field_definition->getFieldStorageDefinition()->isMultiple()) {
         $this->multiple = TRUE;
         // If "Display all values in the same row" is FALSE, then we always limit
         // in order to show a single unique value per row.
         if (!$this->options['group_rows']) {
             $this->limit_values = TRUE;
         }
         // If "First and last only" is chosen, limit the values
         if (!empty($this->options['delta_first_last'])) {
             $this->limit_values = TRUE;
         }
         // Otherwise, we only limit values if the user hasn't selected "all", 0, or
         // the value matching field cardinality.
         if ($this->options['delta_limit'] > 0 && $this->options['delta_limit'] != $cardinality || intval($this->options['delta_offset'])) {
             $this->limit_values = TRUE;
         }
     }
 }
开发者ID:sgtsaughter,项目名称:d8portfolio,代码行数:28,代码来源:Field.php

示例14: init

 /**
  * {@inheritdoc}
  */
 public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL)
 {
     parent::init($view, $display, $options);
 }
开发者ID:vasi,项目名称:views_path,代码行数:7,代码来源:Path.php


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