Welcome Guest, Not a member yet? Register   Sign In
Creating an API
#4

[eluser]dmorin[/eluser]
Also, for anyone who may come across this later, I am using the following route to pull off the fake filetype and pass it to the controller method as an argument:

Code:
$route['^api\/([a-zA-Z_]+)\/([a-zA-Z_]+)\.?([a-zA-z]{3,4})?'] = "api/$1/$2/$3";

I have a folder called API within the controllers folder. Then every API request will have the controller ($1), method ($2), and optional format ($3).

If anyone has any suggestions on how to improve this, I would love to hear it. Thanks.


Messages In This Thread
Creating an API - by El Forum - 08-31-2008, 02:11 PM
Creating an API - by El Forum - 08-31-2008, 03:21 PM
Creating an API - by El Forum - 08-31-2008, 05:43 PM
Creating an API - by El Forum - 08-31-2008, 05:46 PM
Creating an API - by El Forum - 08-31-2008, 06:19 PM
Creating an API - by El Forum - 08-31-2008, 06:33 PM
Creating an API - by El Forum - 08-31-2008, 07:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB