Building API via Codeigniter |
Hi guys!
I build API, and I need that access url was like: http://api.site.local/controller.method[.xml|.json]?param1=value1¶m2=value2 ([.xml|.json] - optional, json will be default) I set next options in my config.php: $config['enable_query_strings'] = TRUE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; and add rewrite rule to .htaccess: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-z]+)\.([a-z]+)(\.(xml|json))?$ index.php?c=$1&m=$2&format=$4 [NC] How can i get input parameters via default method $this->input->get(); |
Welcome Guest, Not a member yet? Register Sign In |