phpwax/wildfire.search

v7.1.x-dev 2013-05-16 16:36 UTC

This package is auto-updated.

Last update: 2024-05-17 11:53:07 UTC


README

Provides SearchController.

Has a config for Search params default is:

public $search_fields = array('text'=>array('cols'=>array('title', 'content'), 'fuzzy'=>true));

'text' is the key on the $_REQUEST search array - $_REQUEST['search']['text']
'cols' are the columns on the model (model is based on the $cms_content_class)
'fuzzy' does a like, otherwise an exact match

all you need to do is make a view in app/view/search/index that uses $results

Now has an inline search ability:

to trigger, add the class 'inline_search_form' to the form, and 'inline_search' to the text element to be monitored for keydowns

this will use the forms action (should be /search/ or a child class of) and appends "_inline" to do an ajax call

you can add filters etc as the form is serialised and all sent to the search

within the form the class 'inline_search_results' will be replaced with the results that are returned

loading, failed & success classes are added the text area

to include the js use this:

<?=js_bundle("core", array(), "wildfire.search")?>