|
|
@ -3,6 +3,8 @@ |
|
|
|
namespace Drupal\roblib_search\Controller; |
|
|
|
namespace Drupal\roblib_search\Controller; |
|
|
|
|
|
|
|
|
|
|
|
use Drupal\Core\Controller\ControllerBase; |
|
|
|
use Drupal\Core\Controller\ControllerBase; |
|
|
|
|
|
|
|
use \Drupal\Core\Url; |
|
|
|
|
|
|
|
use Symfony\Component\HttpFoundation\RedirectResponse; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Controller for d3 graphs. |
|
|
|
* Controller for d3 graphs. |
|
|
@ -16,6 +18,10 @@ class RoblibSearchController extends ControllerBase { |
|
|
|
* A renderable array. |
|
|
|
* A renderable array. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function searchResults($query = NULL) { |
|
|
|
public function searchResults($query = NULL) { |
|
|
|
|
|
|
|
if ($query = $_GET['roblib_query']) { |
|
|
|
|
|
|
|
$url = Url::fromRoute('roblib_search.landing_page', ['query' => $query]); |
|
|
|
|
|
|
|
return new RedirectResponse($url->toString()); |
|
|
|
|
|
|
|
} |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
'#theme' => 'roblib_search_results', |
|
|
|
'#theme' => 'roblib_search_results', |
|
|
|
'#query' => $query, |
|
|
|
'#query' => $query, |
|
|
|