Questions tagged [zend-rest]
46 questions
15
votes
3 answers
Examples of building a REST API server using Zend Framework?
I'm new to Zend Framework (not to PHP), and I need to create a REST based API using Zend.
I've seen examples using Zend_Rest_Server, however other sources state that that has been deprecated.
I'm unable to find a solid example which shows how I…

siliconpi
- 8,105
- 18
- 69
- 107
9
votes
3 answers
How to set up Hierarchical Zend Rest Routes?
With the Zend Framework, I am trying to build routes for a REST api on resources organized in the following…

Kenji Baheux
- 596
- 4
- 14
7
votes
2 answers
Zend framework 2 Rest API : Calls getList() instead of get($id) function
Following is my module config file
return array(
'controllers' => array(
'invokables' => array(
'RSMobile\Controller\User' => 'RSMobile\Controller\UserController',
),
),
// Routes for API calls
'router' => array(
'routes' =>…

Harshal Bulsara
- 7,898
- 4
- 43
- 61
6
votes
2 answers
Zend Framework 1.9.2+ Zend_Rest_Route Examples
With the introduction of Zend_Rest_Route in Zend Framework 1.9 (and its update in 1.9.2) we now have a standardized RESTful solution for routing requests. As of August 2009 there are no examples of its usage, only the basic documentation found in…

Apex
- 1,018
- 1
- 11
- 13
5
votes
2 answers
Zend framework 2 : not able to send desired status code in response
I am building REST API on Zend Framework 2. I want to send certain status code in response whenever any error has occurred.
I tried below in my controller :
$statusCode = 401;
$this->response->setStatusCode($statusCode);
return new…

Geek
- 8,280
- 17
- 73
- 137
4
votes
1 answer
zend rest controller routing to specific controller
I am fairly new to zend framework. I have been trying to write RESTful controller using Zend_Rest_Controller. I built one from a good tutorial
http://www.techchorus.net/create-restful-applications-using-zend-framework
It works perfectly. So I went…

biker46s
- 43
- 5
4
votes
3 answers
Zend framework 2 REST API : set Request parameters
I am new to PHP frameworks and building REST API on Zend Framework 2. I want to add params to Request. I could not find method to add params so I'll do it by getting all params then, adding new params to them and then setting this new set of params…

Geek
- 8,280
- 17
- 73
- 137
3
votes
2 answers
Change addActionContext() to be XML only
I've got Zend code which looks like this:
$contextSwitch->addActionContext('get', array('xml','json'))->initContext();
How can I change this so that it ONLY returns XML formatted data? SOrry, I'm new to Zend programming.!

siliconpi
- 8,105
- 18
- 69
- 107
3
votes
0 answers
How to configure routes for a Rest API in a ZF1 app with custom and optional actions?
We are setting a Rest API in a ZF1 web app and we're having trouble configuring the routes.
The idea is to have a global configuration in the application.ini that includes the 'classical' Rest routes and optional actions.
That means that we want to…

DamienM
- 31
- 1
3
votes
1 answer
More actions in Zend Rest Controller apart from the default actions
I know that REST API can be implemented using Zend_Rest_Controller and it has 5 abstract methods indexAction, getAction, postAction,putAction,deleteAction to perform return, create, update , etc...
My question is, can I have more API fictions with…

Shaolin
- 2,541
- 4
- 30
- 41
2
votes
0 answers
Converting zend_rest's output to json
I am developing a REST api in joomla using Zend_Rest. As Zend components can be decoupled, I am not using the whole Zend framework in my joomla installation but rather the Zend_Loader and the Zend_Rest in creating my application.
The main issue is -…

Dele
- 21
- 1
2
votes
0 answers
zend_rest + mysql + backbone
I implemented a RESTful application with Zend_Rest that saves info in a mysql db.
I'm going to handle the view with Backbone.js.
I'm looking for just a simple CRUD example. How to do that?
I didn't found any examples with Zend_Rest+Backbone, and the…

mtoninelli
- 686
- 1
- 6
- 21
2
votes
1 answer
Zend 1.12 Rest PUT method not allowed
Since I migrated to AWS and update to PHP 5.4 and Zend 1.12, I have a problem with the PUT & DELETE methods.
A quick exemple :
/** Zend 1.12 **/
/** bootstrap / routes **/
$front =…

Crash
- 172
- 2
- 7
2
votes
1 answer
Practical example for Zend RESTful API
I have referred many articles in the web on this subject but got only basic examples. I got some practical issues.
1). In Zend_Rest_Controller there are abstract methods for get, post, put and delete. how do I create my own function rather thean…

Shaolin
- 2,541
- 4
- 30
- 41
1
vote
1 answer
Getting post variables in zend rest controller
I would like to get POST data sent to page controller in init() function but what I get is an empty array.
However, getting getRawBody displays data.
Here is the command I use:
curl http://localhost/api/page/7 -X PUT -d "test=true"
and the output…

debianek
- 589
- 1
- 9
- 30