
| Current Path : /var/www/html1/ift-informatik.de_drupal9/web/core/modules/search/src/Plugin/views/row/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html1/ift-informatik.de_drupal9/web/core/modules/search/src/Plugin/views/row/SearchRow.php |
<?php
namespace Drupal\search\Plugin\views\row;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\row\RowPluginBase;
/**
* Row handler plugin for displaying search results.
*
* @ViewsRow(
* id = "search_view",
* title = @Translation("Search results"),
* help = @Translation("Provides a row plugin to display search results.")
* )
*/
class SearchRow extends RowPluginBase {
/**
* {@inheritdoc}
*/
protected function defineOptions() {
$options = parent::defineOptions();
$options['score'] = ['default' => TRUE];
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$form['score'] = [
'#type' => 'checkbox',
'#title' => $this->t('Display score'),
'#default_value' => $this->options['score'],
];
}
/**
* {@inheritdoc}
*/
public function render($row) {
return [
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#options' => $this->options,
'#row' => $row,
];
}
}