Application:filtering
From Surebert wiki
Contents |
Filtering Input
- You can filter output at two levels.
Globally
By defining a App::filter_all_input(&$input) method in App.php, it receives all page output as an argument and all that is displayed is what it returns. The method is optional.
php code
<?php class App{ public static function filter_all_input(&$input){ foreach($input as $key=>$val){ $input[$key] = strip_tags($val); } } } ?>
Filtering Output
- You can filter output at two levels.
Globally
By defining a App::filter_all_output($out) method in App.php, it receives all page output as an argument and all that is displayed is what it returns. The method is optional.
php code
<?php class App{ function filter_all_output($out){ return str_replace('found', 'pound', $out); } } ?>