Symfony 2.0 and REST - php

What are the best practices for using REST with Symfony 2.0. I've found various questions on SO that discuss Symfony 1.4 (and lower), but nothing for 2.0.

I would look into the FOSREstBundle. It is full of best practices for combining Symfony2 and REST. It also makes the process of developing a REST API in Symfony quite painless.

Related

Using the RESTful API package "FOSRestBundle" outside of a Symfony2 application

I'm supporting a legacy ZF1 application which now needs to expose a RESTful API to the outside world. I'd like to take advantage of a modern PHP package for some of the API's boilerplate functionality (authentication, request parsing, response generation in multiple data formats, etc.) rather than coding it all from scratch, or using ZF1's poorly-documented REST library.
Packagist suggests that FOSRestBundle is the most popular PHP component for developing RESTful API servers. And as far as I understand it, Symfony2 components are flexible enough to be used outside the context of a full Symfony2 framework-based application.
Has anyone has successfully used this particular package outside of a full Symfony2 project? If so, was it painless or were there some significant challenges that you had to overcome? I can see URL routing, and my lack of general Symfony2 knowledge, as potential pain points.
Any advice or suggestions would be greatly appreciated. Thanks!
I'm afraid you can't do it without hacking a lot.
I would recommend you to go for APIgility, there are some tutorials where you can the integration with ZF1. You'll also get the advantages of content negotiation, auth, documentation.

Authorization library on Symfony HttpFoundation Component

Can anyone knows a library to authenticate users using Symfony HttpFondation Component?
PS Symfony Security Component is not suitable, as too big.
PPS Project does not using Symfony Framework.
I don't think there is any (at this time).
PPI framework uses some of the Symfony components (also HttpFoundation). See how they solved it. Otherwise you'd probably need to handle it yourself.

Is there any symfony2 tutorail for complex web application

I have to develop complex web application in symfony 2 where i have 20 database entites and many to many relationships.
I am experienced programmer but i am new to this symfony and OOP.
Is there any tutorial where i i can see many entitties and repositories and thier relationship as an example to start with
thanks
KnpBundles.com is rather complex and available on github.
LilaConceptsBestPracticeBundle is another great bundle showing Symfony 2.1 best practices (covering integration with Travis CI, Code styles fixer, Composer, etc).
I highly recommend these for everybody who is looking for best-practices (like me). :)
I don't know of any very complex tutorials of Symfony2 yet made to the public, but here are some good ones that helped me start out when I was first learning Symfony2:
1) Symblog: http://tutorial.symblog.co.uk/
2) Jobeet: http://sftuts.com/doc/jobeet/en/starting-up-the-project
But I probably learned the most from just reading over the thorough the book/cookbook available on the symfony2 website: http://symfony.com/doc/current/book/index.html
Symfony2 is strictly object oriented, so you might want to read up on OOP as well if you're new to the concept.

Symfony project using CURL - building project with API

I have never used a PHP framework before and am considering using Symfony for my next one. However, I have already built an API which has all my main classes. I will therefore connect to this API using CURL. Can anyone advise on where to start with such a project. I am working through a Symfony tutorial but none of it seems to apply to what I need to do as I do not need to create database connections or classes as I will be building this project on my existing API.
If you don't need a lot of what you see in the Symfony tutorials you might be able to get away with Silex. Silex is a mini-framework with alot of the core aspects of Symfony, but without the extra stuff.
http://silex.sensiolabs.org/

Remoting plugin for cakephp 2.0 and flex

I have a website written in cakephp 1.2 and I'm updating it to cakephp 2.0. This website has a flex front end and I'm using CpAmf plugin for that purpose. It seems like CpAmf plugin has no support with cakephp 2.0 yet. Can anyone recommend me a good remoting plugin for cakephp 2.0 and flex?
Although I don't know of anything out there that supports Cake 2.0+, this might be a really good starting point: http://code.google.com/p/flexiblecake/
At first glance, it seems rather simple to build upon.

Categories