Browse Source

add alternate path for use case of users embedding form elements directly in pages

2.x
Paul Pound 1 year ago
parent
commit
3a1a8db0ff
  1. 6
      src/Controller/RoblibSearchController.php

6
src/Controller/RoblibSearchController.php

@ -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,

Loading…
Cancel
Save