call codeigniter API from outside the framework -
i have iphone application perform calls api developed codeigniter. since new framework, want know such api located ? url requested iphone application api following:
http://example.com/site/welcome/admin/api/processingdocuments/
i got on application/libraries
folder , there bench of php files rest.php
, rest_controller.php
. these files looking for? since url above doesn't point specific file, how know api being called? thank in advance.
when using phil sturgeon's codeigniter restserver (which seems using), set controller within application/controllers
directory , extend class.
let's call controller foobar
, , looks this:
class foobar extends rest_controller { //... methods here }
in case, access endpoint @ http://example.com/foobar
the url references controllers, , not rest_controller directly.
urls this:
http://example.com/{controller}/{method}/{param1}/{param2}/.../{paramn}
if method not specified, defaults index()
further, restserver allows map methods http request methods. such that
get example.com/foobar map method index_get()
post example.com/foobar map method index_post()
..and on.
i highly recommend read documentation
in example, expect controller being called located @ application/controllers/site
.
however, might have been modified using htaccess rewrite rules (check .htaccess
file), or via redefined ci routes (check application/config/routes.php
).
if else fails:
under default configurations, should find them, however, ci malleable routes , hard might be. best bet grep directory words extends rest_controller
since wherever controllers are, extending class.
Comments
Post a Comment