-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
These should normally be passed via the $components variable of your controller:
var $components = array(
'Filter.Filter' => array(
'actions' => array('index')
));An array of actions the component is allowed to filter on. Defaults to array(‘index’), Example:
var $components = array(
'Filter.Filter' => array(
'actions' => array('index', 'admin_index')
));If true then assign the query to Controller::$paginate. Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'autoAssign' => false
));Default date format. Defaults to ‘Y-m-d’. If you use datetime fields, this format must be ‘Y-m-d H:i’ or the form helper will not set the date correctly. Example:
var $components = array(
'Filter.Filter' => array(
'defaultDateFormat' => 'Y-m-d H:i'
));Default operator to use for simple queries, defaults to LIKE. Use null for =. Example:
var $components = array(
'Filter.Filter' => array(
'defaultOperator' => null
));Default time format, defaults to ‘H:i’. Example:
var $components = array(
'Filter.Filter' => array(
'defaultTimeFormat' => 'H'
));Array of field => regexp that dictates urlencoding and sanitization . Your regexp must use capturing fields ie: (). If the pattern is not matched the field will be dropped from the query. Example:
var $components = array(
'Filter.Filter' => array(
'formattedFields' => array(
// index/Bar.length:1'11" (and no I haven't checked to see if this regexp works :p)
'Bar.length' => '/([\d]*)\'([\d]*)\"/'
));Array of fields that should not be filtered on. Defaults to array(). Example:
var $components = array(
'Filter.Filter' => array(
'ignoredFields' => array('User.password')
));If true then redirect and add query data to the new URL. Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'redirect' => false
));If true then sanitize values for redirect using Sanitize::clean(). Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'sanitizeForRedirect' => false
));Settings for Sanitize::clean(). Defaults to array(‘remove_html’ => true). For more info see: http://api.cakephp.org/class/sanitize#method-Sanitizeclean Example:
var $components = array(
'Filter.Filter' => array(
'sanitizeRedirectSettings' => array(
'remove_html' => true,
'odd_spaces' => true
));If true then sanitize values for query. Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'sanitizeForQuery' => false
));Settings for Sanitize::clean() Default is array(‘encode’ => false). For more information see http://api.cakephp.org/class/sanitize#method-Sanitizeclean Example:
var $components = array(
'Filter.Filter' => array(
'sanitizeQuerySettings' => array('encode' => true)
));If true then treat spaces in values as SQL wildcards ‘%’. Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'spaceIsWildcard' => false
));If true then urlencode values before redirect. Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'urlencode' => false
));Assign your real fields to a virtual field type. Defaults to array(). Example:
var $components = array(
'Filter.Filter' => array(
'virtualFields' => array('Post.created' => 'date_range')
));This defines the character used to separate the virtual field name from its sub field name. Defaults to ‘-’.
var $components = array(
'Filter.Filter' => array(
'virtualFieldSeparator' => '-'
));If true then all data values will be wrapped in SQL wildcards ‘%some value%’. Defaults to true. Example:
var $components = array(
'Filter.Filter' => array(
'wrapWildcards' => false
));