All Questions
22 questions
0
votes
1
answer
166
views
Can't Http Delete Method on Simple PHP API using Silex - exceeded subrequest limit
I'm trying to get the hang of PHP and REST by writing a simple shopping list application. At the moment, I'm able to GET and POST to the API, however, everytime I try to run the DELETE method, I'm ...
0
votes
0
answers
136
views
Silex match GET but no POST
Something extremely unusual is happening to me. I have a simple REST API application that handle everything with ControllerProviders. So, in controllers.php I defined
$app->mount('/login', new ...
0
votes
1
answer
223
views
Format suffix in Silex restful framework
I am starting building a RESTful api which supports multiple response formats. I want to recognize the requested response format with the Accept header and alternatively with a file suffix appended to ...
1
vote
1
answer
306
views
PHP Silex - Service Controller - passing a parameter
According to :
Silex - Service Controller Doc
I can define a route like this (after a couple of extra code of corse):
$app->get('/posts.json', "posts.controller:indexJsonAction");
But ... how ...
0
votes
2
answers
255
views
auto discover restful api with Silex
is it possible to make Silex expose the API structure automatically?
What I mean is that I'd like to have a full list of the API endpoints, generated automatically by Silex, on the base of the routes ...
0
votes
3
answers
1k
views
Develop a rest api using Silex framework
I'm starting to develop a rest api using silex. It's my first api!
What i've done:
Update:
Code improved with the tip of Federic . Addition of Use Symfony JsonResponse. Not working for now.
<?...
1
vote
3
answers
2k
views
Silex Controller Dependency Injection
I'm trying to inject a dependency into my Silex Controller, because I need an object of type user in my controller and handle some stuff with it.
$app->mount("/users", new \MyApp\Controller\...
0
votes
2
answers
137
views
Silex url parameter routing incorrectly
I am setting up a site with silex and I am sure this is a n00b question. I have my htaccess set up (per the silex recommendation) to redirect to my home page if a url does not exist.
<IfModule ...
0
votes
1
answer
878
views
Silex gives empty response if HTTP Status code != 200
I'm trying to set up a small Silex RESTFul server, and now I'm playing around with HTTP Headers.
One GET function checks If-Modified-Since header, and compares with database's Last-Modified item.
...
1
vote
1
answer
486
views
Htaccess for Silex
I'm trying Silex for first time but I can't get a simple call with a friendly URL to work properly, but if I use a non friendly URL it does it's job. I'm experimenting in localhost and the domain is
...
0
votes
1
answer
303
views
How do I keep my REST API address in the browser address bar but call a different PHP page?
I have a PHP page that displays product details by passing in the product code like this:
mywebsite/product.php?id=1234
This has all the HTML to generate the page in question, with a small amount of ...
1
vote
2
answers
911
views
How do you pass Content-Type header when testing Silex REST service?
I'm testing a Silex REST service as explained here but also trying to automatically decode JSON data as is also explained in the manual but somehow it fails to create the $data parameter.
In my test ...
3
votes
4
answers
4k
views
Good resource for building restful API
I am looking for a good resource which will show me the right way for building a restful API.
Interesting topics: Authentication in particular and security in general, performance, scalability, best ...
0
votes
1
answer
1k
views
Silex: put and post handled differently
I'm using Silex to create a REST API. I created an update method which takes a resource id and request data and updates the matching resource.
At first I tested it using the route:
$api->post('/...
4
votes
0
answers
3k
views
Silex security firewall to authenticate against a REST API via form
I am trying to set my app's security layer without any success. What I am trying to do is setting a security firewall via a form authentication listener but customized for authenticating the user ...
1
vote
2
answers
2k
views
Backbone.js/Silex CORS request
I'm currently experimenting with Backbone.js and I'm having a bit of trouble with CORS requests.
I've set up a basic PHP-based API using Silex and set the Backbone model/collection to point it. ...
0
votes
1
answer
1k
views
Silex REST login - How does it work?
I'm using Silex for the backend of an angularjs app. I wanna realize an user-authentication. I used this tutorial (http://www.bubblecode.net/en/2012/08/28/mysql-authentication-in-silex-the-php-micro-...
6
votes
2
answers
3k
views
Silex - OPTIONS method
I'm using Silex framework for mocking REST server. I need to create uri for OPTIONS http method, but Application class offers only methods for PUT, GET, POST and DELETE. Is it possible to add and use ...
7
votes
2
answers
4k
views
RESTful webservice with Silex PHP : good choice? [closed]
I have to create a REST API for a mobile application and I don't really know how to begin it.
I read some articles and tutorial about REST in general, but I didn't find a complexe API example written ...
6
votes
3
answers
10k
views
Validation of POST data without a model in Silex / Symfony 2?
I'm building a RESTful application that will serve only json/xml data and i've chosen Silex because i already know (a bit) Symfony 2 and because is small, i don't need Twig, etc...
There are no ...
7
votes
2
answers
5k
views
REST web services: Symfony 2 vs silex [closed]
We're going to implement a set of REST web services in PHP. We've selected 2 frameworks to do that: Symfony 2 and Silex (micro-framework as a phar archive, based on Symfony2).
For now, there will be ...
14
votes
3
answers
8k
views
Backbone.js and REST api with Silex (PHP)
lets say I have a model called John with those params:
{
Language : {
code : 'gr',
title : 'Greek'
},
Name : 'john'
}
So now when I trigger John.save() it POST ...