SimpleSearch icon indicating copy to clipboard operation
SimpleSearch copied to clipboard

make search results available in posthooks

Open sandropons opened this issue 11 years ago • 1 comments

I think it would be helpful to have a search result array to be used in posthooks.

sandropons avatar May 07 '13 10:05 sandropons

with little effort i've achieved it.

before: $search->postHooks->loadMultiple($postHooks,$response['results'],array( 'hooks' => $postHooks, 'search' => $searchString, 'offset' => !empty($_GET[$offsetIndex]) ? intval($_GET[$offsetIndex]) : 0, 'limit' => $limit, 'perPage' => $limit, ));

after: $search->postHooks->loadMultiple($postHooks,$response['results'],array( 'hooks' => $postHooks, 'search' => $searchString, 'offset' => !empty($_GET[$offsetIndex]) ? intval($_GET[$offsetIndex]) : 0, 'limit' => $limit, 'perPage' => $limit, 'response' => $response['results'], ));

so in posthook snippet the search result is available in the $response variable.

HTH

sandropons avatar May 07 '13 13:05 sandropons