tags:

views:

1611

answers:

16

I've never used any public framework (always used internal frameworks, or my own). I see that Symfony has a lot of tutorials and nice documentation and seems to have everything from CRUD to multiple language handling.

Do you think it's a good framework to build a website that is more complicated than a blog*? If not, what is another alternative?

*Website with login to manage financial data.

+12  A: 

Yes, it's a great framework. I've used it to build several sites of various complexities. One is a small-business site with only a handful of pages and a contact form. Another is a complex file delivery site with thousands of users and tens of thousands of transactions per month. Several of my clients use it- one has over 100k users.

There is a good user community, irc usually has helpful people, and there are several plugins to make common tasks easy. It has a really nice admin generator. The ORM (Propel) is a bit wordy, but allows for most of your common database features- constraints, foreign keys, indexes, etc. The Form objects in 1.1 are nice.

Biggest complaints: it's wordy and directory-heavy. Over-use of config files can make things a bit difficult to figure out.

Definitely recommended.

jcoby
+1  A: 

Here is some information that I just found:

  • MVC driven design
  • ORM using Yaml
  • Work on Linux and Windows
  • Use layout and template
Daok
Yaml is just the configuration language for the schema. ORM is actually done by Propel or Doctrine.
Peter Bailey
+2  A: 

@Daok

Yaml is only used in the ORM to define your schema. It doesn't really define any behavior. Propel is based on generated code and it uses the schema.yml to create the models.

It works on OS X as well.

It also has a pretty good caching layer.

jcoby
HUm thx! +1 But if I have a MySQL database already created I think I can get the schemas.xml from it right?
Daok
+1  A: 

Symfony doesn't work with PHP 4. Systems hosting apps specific to PHP4 will not be able to use Symfony. If PHP4 is not a requirement, symfony is a very good option.

Gaurav
Thx for the info +1
Daok
A: 

I am still not sure because I do not see a lot of project that have used that framework... CakePHP and Zend look more popular but Symfony seems interesting...

Daok
A: 

Zend seems superior, but really lacks in documentation.

Vasil
Zend is a collection of tools whereas Symfony is a full stack framework. They are not really comparable in this way.
Jon Winstanley
+1  A: 

Symfony is the best choice. I worked with it in a lot of apps and it's the best framework i ever used. The documentation and the community help is very handfull and the framework itself is very easy to learn and work.

A: 

I don't see the complexity of the app as being a hurdle to adopting symfony.

I don't think anyone would choose symfony for high performance reasons but the same s probably true of all the major frameworks. Having said that we have had absoutely no performance problems.

Probably not the best to compare it to Zend, Symfony is very much a full stack framework, you need to be prepared to do things the Symfony way. I found it to be a pleasure to use. I'd recommend reading the official symfony book (available online) in full before getting started. Propel (symfonys ORM) was a bit frustrating to learn but it does work well once you get over the learning curve.

Its really packed with useful stuff and gets better the more you use it.

Dan Powley
A: 

As Gaurav mentioned, Symphony doesn't support PHP4. If you're looking for a decent PHP framework that does you may want to check out Code Igniter.

LaSean Smith
Do people still use PHP4? I've found Code Igniter limiting because it has to support PHP4 (no PDO).
Kyle Cronin
Why would anyone want to develop in PHP4? Especially a new project!
Jon Winstanley
+1  A: 

We've been using sf at work for the last 6 months and so far i'm quite impressed with it. There is a pretty healthy plugin development community built around it and the main framework seems to be developing really quite quickly. The 1.2 version which is coming out in December will make the framework officially agnostic to using Propel or Doctrine for the ORM layer which ads a great deal of flexibility for the end user. The initial learning curve is a bit steep as it there is definitely a "symfony way" you have to get accustomed to, but like with other full stack frameworks like Rails, once you grok what its all about I find development to be quite speedy.

vitriolix
A: 

For alternatives I've used CakePHP. Over the last 10 months I've built a few apps blog-level complexity apps with it for internal use. It was fantastic for that. Easy to get into, doesn't need a very recent php, the docs are decent and failing to find an answer there it usually was found in the mailing list.

The main problem I had with Cake was that I didn't feel I had that much control over their ORM, and although they have improved in that area recently with the addition of support for group clauses I still can't specify joins explicitly. This leads to situations where you can have poor performance because the orm decides it needs to do a bunch of queries to get data from related models. Or you can use hacks like this http://teknoid.wordpress.com/2008/07/17/forcing-an-sql-join-in-cakephp/ which works but it's kinda ugly. As the apps started to grow and more and more models were added to the schema I started to run into the situation more and more often so I decided to switch to something that supported an ORM with more features (I had other isses with cake but most were pretty minor). It irked me for a while but I've settled with the notion that cake is an excellent tool, just not the right tool for me.

I looked at Zend and Symfony mainly (I only skimmed the CodeIgniter docs and watched the screencast). I ended up picking up Symfony because it seemed to have the right balance of power and ease of use. It can use Doctrine and Propel, theres's a lot of plugins, and a lot of docs. I buckled up ready to deal with the million yml files I thought I'd have to edit but to my surprise I haven't had to configure all that much. Zend looks pretty powerful but it seems a bit too much of Do It Yourself for my current projects. From what I read I can also use the Zend libs within my symfony projects without too much trouble so that sealed the deal.

So in summary, which you choose would depend on your needs. If you see yourself doing complex queries you should probably pick one that sports a very good database library or at least lets you easily use an alternate one without giving up the framework's niceties (I understand CodeIgniter can use doctrine for example).

Ariel Arjona
+5  A: 

I used Symfony for a (now defunct) project. It seemed really good, but in the end I wasn't too impressed with it.

It was very polished and had good documentation. There was nothing specifically wrong with it. It just seemed that everything was more difficult that it needed to be.

  • The active record pattern was nice to start with, but eventually just started being a performance bottleneck. The pattern entices you to use multiple database lookups rather than a join.

  • Propel made any complex SQL queries quite difficult. Creole allowed you to "construct" quesries in an OO manner, but writing SQL by hand would have been much easier.

  • There is a strong preference for configuration over code (Symfony loves yaml). This means you will need to constantly be looking for which configuration file and which option you need to change. If you stick your configuration definition in the wrong level (e.g. under the wrong parent node) then you're not going to know why things aren't working.

  • The documentation seemed a bit tutorial focused. Often I just wanted a really solid reference. This was often related to looking for a configuration definition.

  • The structure of the framework is quite rigid. You have to implement things exactly the way the designers intended.

  • The framework ended up being quite slow. We were trying to handle a moderate amount of traffic (maybe 50,000 uniques a day) and the server we used just couldn't take it.

Many of these issues would disappear after a few Symfony projects. If I were to look for a new framework then I'd probably look at Code Ignitor, it's meant to be far more simple and light weight.

After Symfony I ended up writing a very small framework to enforce a MVC pattern. I liked this much better as I could evolve the framework code to match my specific problems. This is not really the "right" thing to do, but it worked out for me. I've used it in about half a dozen projects and I've added and trimmed my code to keep it light weight.

Josh
I have try symphony and you are right about the tutorial focus. The problem is that they just release the tutorial for the current release so I've try to learn from old documentation and lot of thing has changed so my experience was hell. Hope they fix their stuff.
Daok
Symfony is an enterprise level framework. If you want something basic, use CodeIgniter. If you want to start a company and make a living around your web app, use Symfony.
Jon Winstanley
A: 

Symfony, Zend and CakePHP, which one is better? Can any experienced developer give me suggestion? Thanks!

+1  A: 

Symfony is a good framework, that uses about the same design patterns that make up Ruby on Rails, but it's not "PHP on Rails", since it has its own pros and cons.

As of Symfony 1.2 Doctrine is the second ORM, that's packaged with it. For older versions there are plugins.

About the whole YAML business: If you prefer XML configuration files or still other file format, you can plug that in. YAML is just the default one.

Last but not least, you can break out of the default structure (still you have to configure that). The documentation (cf the Symfony Book) states that explicitly.

Ultimatively, it's a matter of taste and personal preference. My advice would to read the Symfony Book (you can get it for free from the project website) and try to follow the example project. If you like that, use it. If not, try something else.

Jochen
A: 

I like codeigniter personally, because it's so easy to code with and very well documented.

A: 

SEEMS to have good documentation but in details when you try to follow it, it's a nightmare.

programmernovice
Really? I find the book to be excellent and there are several very useful tutorials on the web.
Jon Winstanley