cloudwords-8.x-1.x-dev/src/Plugin/views/field/AddToProjectCheckbox.php

src/Plugin/views/field/AddToProjectCheckbox.php
<?php

namespace Drupal\cloudwords\Plugin\views\field;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Form\FormInterface;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;

/**
 * Field handler to flag the node type.
 *
 * @ingroup views_field_handlers
 *
 * @ViewsField("add_to_project_checkbox")
 */
class AddToProjectCheckbox extends FieldPluginBase {

  /**
   * @{inheritdoc}
   */
  public function query() {
    // Leave empty to avoid a query on this field.
  }

  /**
   * Define the available options
   * @return array
   */
  protected function defineOptions() {
    $options = parent::defineOptions();
    return $options;
  }

  /**
   * Provide the options form.
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
  }

  /**
   * @{inheritdoc}
   */
  public function render(ResultRow $values) {
    $entity = $values->_entity;
    $form = \Drupal::formBuilder()->getForm('Drupal\cloudwords\Form\CloudwordsTranslatableAddToProjectCheckbox', $entity);
    return $form;
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc