SlickViews.php in Slick Views 7.3
File
src/Plugin/views/style/SlickViews.php
View source
<?php
namespace Drupal\slick_views\Plugin\views\style;
class SlickViews extends SlickViewsBase {
public function options_form(&$form, &$form_state) {
$definition = $this
->getDefinedFormScopes();
$this
->buildSettingsForm($form, $definition);
}
public function render() {
$settings = $this
->buildSettings();
$elements = [];
foreach ($this
->render_grouping($this->view->result, $settings['grouping']) as $rows) {
$build = $this
->buildElements($settings, $rows);
if (empty($settings['vanilla']) && isset($build['items'][0])) {
$this
->blazyManager()
->isBlazy($settings, $build['items'][0]);
}
$settings['first_image'] = isset($rows[0]) ? $this
->getFirstImage($rows[0]) : [];
$build['settings'] = $settings;
$elements = $this
->manager()
->build($build);
unset($build);
}
if (empty($this->view->result) && $this->view->use_ajax) {
$elements['#markup'] = ' ';
$elements['#attached'] = $this
->manager()
->attach($settings);
}
return $elements;
}
}