forked from pi-engine/pi
-
Notifications
You must be signed in to change notification settings - Fork 0
Dev.Filtering
Taiwen Jiang edited this page Jul 13, 2013
·
1 revision
- Input filtering
- Read parameters from input: see
Pi\Utility\Filter
;Pi\Mvc\Controller\Plugin\Params
- GET:
$var = _get('var_name', 'int');
alias in a controller action:$var = $this->params()->get('var_name', 'int');
- POST:
$var = _post('var_name', 'int');
alias in a controller action:$var = $this->params()->post('var_name', 'int');
- PUT:
$var = _put('var_name', 'int');
alias in a controller action:$var = $this->params()->put('var_name', 'int');
- Generic:
$var = _request('var_name', 'int');
alias in a controller action:$var = $this->params()->request('var_name', 'int');
- GET:
- Read parameters from input: see
- Filter a value:
$var = _filter($rawValue, 'email');
- Sanitize a value:
$value = _sanitize($rawValue, 'float', 'allow_thousand');
- Escape a string: `$escapedText = _escape($rawText[, ''|'html'|'css'|'url']);
- Strip a string: `$strippedText = _strip($rawText[, ' '|'-']);