How to create an API-oriented application (more specifically: for HMVC in CodeIgniter)

Reference Information:

I am working on a web application that I plan to launch with versions of iPhone and Android in the near future, and I have some questions about developing an API for using different interfaces.

I started with this:

I read this TutsPlus tutorial that talks about creating an API-oriented web application, which means that all your browser calls and smartphone application calls are routed through the API.

What turned me on especially was this expression in a textbook from Twitter:

One of the most important architectural changes is that Twitter.com is now a client of our own API. It retrieves data from the same endpoints as the mobile site, our apps for iPhone, iPad, Android and third-party apps.

The above statement reflects what I would ideally want to create.

Then I saw this:

I found this TutsPlus tutorial that talks about how to create a REST API for CodeIgniter. This was good because I am developing my application in CodeIgniter using the Modular Extensions plugin - HMVC , and I thought it would be perfect for my purposes.

, , - Phil Sturgeon, API. , API ( ). , , API.

, :

:

  • API- , ,
  • REST API CodeIgniter ( HMVC)

:

  • API- ?
  • CodeIgniter Phil Sturgeon , HVMC?
  • ?
  • ?
+5
1

" " . CICONF 2012, , .

API - , API . , , , HTTP- , , HMVC, .

HMVC, , API. /api, ​​ , PyroCMS Professional API , API:

$route['api/([a-zA-Z0-9_-]+)/(:any)']       = '$1/api/$2';
$route['api/([a-zA-Z0-9_-]+)']              = '$1/api/index';

, "api.php" /api/controller/method /api/controller, function index_get().

PyroCMS Professional . , , , , .. .

+2

All Articles