I need to trim every $this->input->get('q', true);
in my projects. is there a way to do this instead of adding trim()
every time?
Naim Malek told me to use helper, but I don't quite understand how it would work in this case..
I need to trim every $this->input->get('q', true);
in my projects. is there a way to do this instead of adding trim()
every time?
Naim Malek told me to use helper, but I don't quite understand how it would work in this case..
You can use hooks for trimming every 'q' get parameter.
First enable hooks in application/config/config.php
Then create a file with custom name (example: Trim_hooks.php) in application/hooks and write below code in hook config file(application/config/hooks.php) file.
At the end create Trim_hooks.php file in application/hooks:
Every time you have q parameter in GET, it's trimming after run controllers constructoror.