public function Comment::init in Views (for Drupal 7) 8.3
Override init function to provide generic option to link to comment.
Overrides FieldPluginBase::init
File
- lib/
Views/ comment/ Plugin/ views/ field/ Comment.php, line 29 - Definition of Views\comment\Plugin\views\field\Comment.
Class
- Comment
- Field handler to allow linking to a comment.
Namespace
Views\comment\Plugin\views\fieldCode
public function init(ViewExecutable $view, &$options) {
parent::init($view, $options);
if (!empty($this->options['link_to_comment'])) {
$this->additional_fields['cid'] = 'cid';
$this->additional_fields['nid'] = 'nid';
}
}