You are here

protected function ViewsPhp::defineOptions in Views PHP 8

Same name in this branch
  1. 8 src/Plugin/views/area/ViewsPhp.php \Drupal\views_php\Plugin\views\area\ViewsPhp::defineOptions()
  2. 8 src/Plugin/views/filter/ViewsPhp.php \Drupal\views_php\Plugin\views\filter\ViewsPhp::defineOptions()
  3. 8 src/Plugin/views/sort/ViewsPhp.php \Drupal\views_php\Plugin\views\sort\ViewsPhp::defineOptions()
  4. 8 src/Plugin/views/access/ViewsPhp.php \Drupal\views_php\Plugin\views\access\ViewsPhp::defineOptions()
  5. 8 src/Plugin/views/cache/ViewsPhp.php \Drupal\views_php\Plugin\views\cache\ViewsPhp::defineOptions()
  6. 8 src/Plugin/views/field/ViewsPhp.php \Drupal\views_php\Plugin\views\field\ViewsPhp::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides TokenizeAreaPluginBase::defineOptions

File

src/Plugin/views/area/ViewsPhp.php, line 25
Definition of Drupal\views_php\Plugin\views\area\ViewsPhp.

Class

ViewsPhp
Views area PHP text handler.

Namespace

Drupal\views_php\Plugin\views\area

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['php_output'] = array(
    'default' => "<h4>Example PHP code</h4>\n<p>Time: <?php print date('H:i', time());?></p>\n",
  );
  return $options;
}