Skip to content

ravikumarjogu/Silex-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silex-REST-API

Restful architecture for silex php framework and resources being used as another api from heroku.

Used

Silex framework:

Install Silex framework:

  • Install step by step, can be seen here

Includes

RESTful architecure simplifies the routes for given resources for ex: users

CRUD operations performed on the users resources by defining the following routes in ./index.php.

Silex provides the smooth way to do this.

Need routes:

METHOD[action] url

GET localhost/
GET[index] localhost/users
GET[new] localhost/users/new
POST[create] localhost/users
GET[show] localhost/users/{id}
GET[edit] localhost/users/{id}/edit
PUT[update] localhost/users/{id}
DELETE[destroy] localhost/users/{id}

Silex framework style:

Sample:
$app->get('/', function (Silex\Application $app)  {
return "String or Collection" or "render some page";
});

REST routes can be found in <code>./index.php</code>

Running

* Run apache2 
$ sudo service apache2 start

if nginx runnning default stop using
$sudo service nginx stop

Open in your browser.

why

  • A sample app for Silex how to build REST routes and integration with API.

Alternatives

Can be found here

References

About

Restful architecture for silex php framework and resource being available on other API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published