function Category::render_link in Views (for Drupal 7) 8.3
Render whatever the data is as a link to the category.
Data should be made XSS safe prior to calling this function.
1 call to Category::render_link()
- Category::render in lib/
Views/ aggregator/ Plugin/ views/ field/ Category.php - Render the field.
File
- lib/
Views/ aggregator/ Plugin/ views/ field/ Category.php, line 60 - Definition of Views\aggregator\Plugin\views\field\Category.
Class
- Category
- Field handler to provide simple renderer that allows linking to aggregator category.
Namespace
Views\aggregator\Plugin\views\fieldCode
function render_link($data, $values) {
$cid = $this
->get_value($values, 'cid');
if (!empty($this->options['link_to_category']) && !empty($cid) && $data !== NULL && $data !== '') {
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = "aggregator/category/{$cid}";
}
return $data;
}