passing query parameters to options to search interfaces

This commit is contained in:
Julien Fastré 2019-05-02 23:10:35 +02:00
parent cd855c2241
commit 18463fb18a
2 changed files with 15 additions and 1 deletions

View File

@ -92,7 +92,11 @@ class SearchController extends Controller
$name,
$paginatorFactory->getCurrentPageFirstItemNumber(),
$paginatorFactory->getCurrentItemsPerPage(),
array(SearchInterface::SEARCH_PREVIEW_OPTION => false),
array(
SearchInterface::SEARCH_PREVIEW_OPTION => false,
SearchInterface::REQUEST_QUERY_PARAMETERS => $request
->get(SearchInterface::REQUEST_QUERY_KEY_ADD_PARAMETERS, [])
),
$_format
)];

View File

@ -33,6 +33,16 @@ interface SearchInterface
{
const SEARCH_PREVIEW_OPTION = '_search_preview';
/**
* Request parameters contained inside the `add_q` parameters
*/
const REQUEST_QUERY_PARAMETERS = '_search_parameters';
/**
* Supplementary parameters to the query string
*/
const REQUEST_QUERY_KEY_ADD_PARAMETERS = 'add_q';
/**
* return the result in a html string. The string will be inclued (as raw)