Digital Fashion

Rien de grand ne se fit jamais sans enthousiasme.

To content | To menu | To search

Keyword - controller

Entries feed - Comments feed

Accessing raw post data in a controller

For some reason, $HTTP_RAW_POST_DATA does not seem to be set inside an action controller. You'll have to use the php://input stream wrapper to access raw http post data:

$raw_post_data = file_get_contents('php://input');

A Zend controller plugin to enable RESTful behaviour

This is a simple controller plugin for the Zend Framework which enable RESTful behaviour. It basically adds the HTTP method name to the action name, so that the URL http://example.com/foo/bar will be dispatched to FooController::barGetAction on a GET, FooController::barPostAction on a POST, etc.

Continue reading...