3 namespace Drupal\views_test_data\Plugin\views\field;
5 use Drupal\views\Plugin\views\field\FieldPluginBase;
6 use Drupal\views\ResultRow;
9 * @ViewsField("test_field")
11 class FieldTest extends FieldPluginBase {
15 * A temporary stored test value for the test.
22 * Sets the testValue property.
24 * @param string $value
25 * The test value to set.
27 public function setTestValue($value) {
28 $this->testValue = $value;
32 * Returns the testValue property.
36 public function getTestValue() {
37 return $this->testValue;
43 protected function addSelfTokens(&$tokens, $item) {
44 $tokens['{{ test_token }}'] = $this->getTestValue();
50 public function render(ResultRow $values) {
51 return $this->sanitizeValue($this->getTestValue());
55 * A mock function which allows to call placeholder from public.
58 * The result of the placeholder method.
60 public function getPlaceholder() {
61 return $this->placeholder();