FieldTest.php in Zircon Profile 8
File
core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldTest.php
View source
<?php
namespace Drupal\views_test_data\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
class FieldTest extends FieldPluginBase {
protected $testValue;
public function setTestValue($value) {
$this->testValue = $value;
}
public function getTestValue() {
return $this->testValue;
}
protected function addSelfTokens(&$tokens, $item) {
$tokens['{{ test_token }}'] = $this
->getTestValue();
}
public function render(ResultRow $values) {
return $this
->sanitizeValue($this
->getTestValue());
}
public function getPlaceholder() {
return $this
->placeholder();
}
}
Classes
Name |
Description |
FieldTest |
Plugin annotation
@ViewsField("test_field"); |