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


PHP field\FieldPluginBase类代码示例

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


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

示例1: defineOptions

 /**
  * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
  */
 protected function defineOptions()
 {
     $options = parent::defineOptions();
     $options['label'] = array('default' => $this->definition['title'], 'translatable' => TRUE);
     $options['gcal'] = array('default' => '');
     $options['class'] = array('default' => 'fc-event-default fc-event-gcal');
     $options['timezone'] = array('default' => date_default_timezone_get());
     return $options;
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:12,代码来源:GoogleCalendar.php

示例2: buildOptionsForm

 /**
  * Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions().
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $modules = system_get_info('module');
     $names = array();
     foreach ($modules as $name => $module) {
         $names[$name] = $module['name'];
     }
     $form['data_module'] = array('#title' => $this->t('Module name'), '#type' => 'select', '#description' => $this->t('The module which sets this user data.'), '#default_value' => $this->options['data_module'], '#options' => $names);
     $form['data_name'] = array('#title' => $this->t('Name'), '#type' => 'textfield', '#description' => $this->t('The name of the data key.'), '#default_value' => $this->options['data_name']);
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:14,代码来源:UserData.php

示例3: defineOptions

 /**
  * {@inheritdoc}
  */
 protected function defineOptions()
 {
     $options = parent::defineOptions();
     $options['fields'] = array('default' => array());
     $options['destination'] = array('default' => 1);
     return $options;
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:10,代码来源:ContextualLinks.php

示例4: buildOptionsForm

  /**
   * Provide the options form.
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    // Link options.
    $form['link_photo'] = array(
      '#title' => t("Link image"),
      '#description' => t("Link the image to the album page or image page."),
      '#type' => 'radios',
      '#options' => array(
        '' => $this->t('None'),
        'album' => $this->t('Album page'),
        'image' => $this->t('Image page')
      ),
      '#default_value' => $this->options['link_photo']
    );

    // Get image styles.
    $style_options = image_style_options();
    $form['image_style'] = array(
      '#title' => $this->t('Image style'),
      '#type' => 'select',
      '#default_value' => $this->options['image_style'],
      '#options' => $style_options,
    );

    parent::buildOptionsForm($form, $form_state);
  }
开发者ID:AshishNaik021,项目名称:iimisac-d8,代码行数:28,代码来源:PhotosImage.php

示例5: __construct

 /**
  * Constructs a 'Disqus Comment Count' view field plugin.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  * @param \Drupal\disqus\DisqusCommentManager $disqus_manager
  *   The disqus comment manager object.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, DisqusCommentManager $disqus_manager, ConfigFactoryInterface $config_factory)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->currentUser = $current_user;
     $this->disqusManager = $disqus_manager;
     $this->config = $config_factory->get('disqus.settings');
 }
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:23,代码来源:DisqusCommentCount.php

示例6: buildOptionsForm

 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $options = array('' => t('- All -'));
     $options += JobItem::getStates();
     $form['state'] = array('#title' => t('Job item state'), '#description' => t('Count only job items of a certain state.'), '#type' => 'select', '#options' => $options, '#default_value' => $this->options['state']);
 }
开发者ID:andrewl,项目名称:andrewlnet,代码行数:10,代码来源:ItemCount.php

示例7: buildOptionsForm

 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['range'] = array('#type' => 'textfield', '#title' => t('Range'), '#description' => t('The range of weights available to select. For
     example, a range of 20 will allow you to select a weight between -20
     and 20.'), '#default_value' => $this->options['range'], '#size' => 5);
 }
开发者ID:k-zafar,项目名称:barney_river,代码行数:10,代码来源:WeightSelector.php

示例8: buildOptionsForm

 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     // Only show fields that precede this one.
     $field_options = $this->getPreviousFieldLabels();
     $form['fields'] = array('#type' => 'checkboxes', '#title' => $this->t('Fields'), '#description' => $this->t('Fields to be included as links.'), '#options' => $field_options, '#default_value' => $this->options['fields']);
     $form['destination'] = array('#type' => 'checkbox', '#title' => $this->t('Include destination'), '#description' => $this->t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'), '#default_value' => $this->options['destination']);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:11,代码来源:Links.php

示例9: buildOptionsForm

 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['text'] = array('#type' => 'textfield', '#title' => $this->t('Text to display'), '#default_value' => $this->options['text']);
     parent::buildOptionsForm($form, $form_state);
     // The path is set by renderLink function so don't allow to set it.
     $form['alter']['path'] = array('#access' => FALSE);
     $form['alter']['external'] = array('#access' => FALSE);
 }
开发者ID:dev981,项目名称:gaptest,代码行数:11,代码来源:Link.php

示例10: 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

示例11: submitOptionsForm

 /**
  * @inheritdoc
  */
 public function submitOptionsForm(&$form, FormStateInterface $form_state)
 {
     // Merge plural format options into one string and drop the individual
     // option values.
     $options =& $form_state->getValue('options');
     $options['format_plural_string'] = implode(LOCALE_PLURAL_DELIMITER, $options['format_plural_values']);
     unset($options['format_plural_values']);
     parent::submitOptionsForm($form, $form_state);
 }
开发者ID:brstde,项目名称:gap1,代码行数:12,代码来源:NumericField.php

示例12: buildOptionsForm

 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     // Remove the checkbox
     unset($form['alter']['alter_text']);
     unset($form['alter']['text']['#states']);
     unset($form['alter']['help']['#states']);
     $form['#pre_render'][] = array($this, 'preRenderCustomForm');
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:9,代码来源:Custom.php

示例13: getValue

 /**
  * @inheritDoc
  */
 public function getValue(ResultRow $values, $field = NULL)
 {
     $value = NULL;
     $cat_id = parent::getValue($values, $field);
     if ($cat_id) {
         $value = $this->entityStorage->load($cat_id)->getName();
     }
     return $value;
 }
开发者ID:bonrita,项目名称:moodle,代码行数:12,代码来源:Category.php

示例14: buildOptionsForm

 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     $form['text'] = ['#type' => 'textfield', '#title' => $this->t('Text to display'), '#default_value' => $this->options['text']];
     parent::buildOptionsForm($form, $form_state);
     // The path is set by ::renderLink() so we do not allow to set it.
     $form['alter'] += ['path' => [], 'query' => [], 'external' => []];
     $form['alter']['path'] += ['#access' => FALSE];
     $form['alter']['query'] += ['#access' => FALSE];
     $form['alter']['external'] += ['#access' => FALSE];
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:13,代码来源:LinkBase.php

示例15: __construct

 /**
  * Constructs a new instance.
  *
  * @param mixed[] $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
  *   The string translator.
  * @param \Drupal\Core\Entity\EntityStorageInterface $currency_storage
  *   THe currency storage.
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(array $configuration, $plugin_id, array $plugin_definition, TranslationInterface $string_translation, EntityStorageInterface $currency_storage)
 {
     if (!isset($configuration['currency_method'])) {
         throw new \InvalidArgumentException('Missing currency_method definition.');
     } elseif (!method_exists(CurrencyInterface::class, $configuration['currency_method'])) {
         throw new \InvalidArgumentException(sprintf('Method %s does not exist on \\Drupal\\currency\\Entity\\CurrencyInterface.', $configuration['currency_method']));
     }
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->currencyStorage = $currency_storage;
     $this->stringTranslation = $string_translation;
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:27,代码来源:Currency.php


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