You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1010 B
43 lines
1010 B
<?php |
|
|
|
namespace Drupal\roblib_search_solr_site\Plugin\Block; |
|
|
|
use Drupal\Core\Block\BlockBase; |
|
|
|
/** |
|
* Provides EDS Article search results. |
|
* |
|
* @Block( |
|
* id = "roblib_search_solr_site_bestbet_block", |
|
* admin_label = @Translation("Roblib Search Solr Bestbet Block"), |
|
* category = @Translation("Roblib Search"), |
|
* ) |
|
*/ |
|
class RoblibSearchSolrSiteBestbet extends BlockBase { |
|
|
|
/** |
|
* {@inheritdoc} |
|
*/ |
|
public function build() { |
|
$search_url = \Drupal::config('roblib_search_solr_site.settings') |
|
->get('solr_site_url'); |
|
$settings = [ |
|
'solr_site_search_url' => $search_url, |
|
'solr_bestbet_base_url' => '/roblib_search/solr_site/bestbet/', |
|
]; |
|
return [ |
|
'#theme' => 'roblib_search_solr_site_bestbet', |
|
//'#solr_type' => 'bestbet', |
|
'#attached' => [ |
|
'library' => [ |
|
'roblib_search_solr_site/solr-bestbet' |
|
], |
|
'drupalSettings' => $settings, |
|
], |
|
]; |
|
} |
|
|
|
/*public function getCacheMaxAge() { |
|
return 1; |
|
}*/ |
|
}
|
|
|