|
|
|
@ -3,6 +3,8 @@
|
|
|
|
|
namespace Drupal\roblib_search\Controller; |
|
|
|
|
|
|
|
|
|
use Drupal\Core\Controller\ControllerBase; |
|
|
|
|
use \Drupal\Core\Url; |
|
|
|
|
use Symfony\Component\HttpFoundation\RedirectResponse; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Controller for d3 graphs. |
|
|
|
@ -16,6 +18,10 @@ class RoblibSearchController extends ControllerBase {
|
|
|
|
|
* A renderable array. |
|
|
|
|
*/ |
|
|
|
|
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 [ |
|
|
|
|
'#theme' => 'roblib_search_results', |
|
|
|
|
'#query' => $query, |
|
|
|
|