views:

113

answers:

3

We are developing a mobile version of our current site, and will prefer to read from the same DB as the main site. Given that this will be a mobile site, it will have only minimal (search + display) functionality.

From what I gather, most framework make it very difficult to use an existing DB.

Given the above, which PHP framework would you recommend for creating a new website with an existing database?

Additionally links to relevant documents will help.

A: 

You can use the Symfony framework along with the Doctrine ORM, which does have support for using existing databases.

Zed
+2  A: 

In addition to what Zed said, you can use Doctrine (an ORM framework) alongside other frameworks as well : it is the default ORM Framework of symfony, but is independant.

I've successfully used it with Zend Framework, for instance.
Which is another great MVC Framework that can be used with an existing DB ;-)


As a sidenote : if you already have an existing website, can you not just redesign the "presentation" part, and keep most of the existing code you already have for Database access ? (Would be the View component in MVC)

I guess you can't, if you did not separate content/behaviour from presentation when you designed the existing website :-(
Maybe it could be the time to redesign the whole stuff, to have a common base that can be used both for mobile and "non-mobile" versions ?

Of course, it'd mean that it would cost more now... But, in the long term...

Pascal MARTIN
Will try Doctrine as codeigniter and report back.
+1  A: 

It seems most of the big frameworks (Cake, Symfony, Zend etc.) could be a bit overkill for such a simple site.

I'd suggest using either

  • Codeigniter - Very simple to use and has just the right amount of features to get the job done. It works with PHP4 and has some of the best [PHP] framework documentation
  • Kohana - Again, lightweight and has a pretty shallow learning curve. On the flipside it's PHP5 only and it's worth noting that there is a bit of confusion going on at the moment as 2 different versions (2.4 & 3.0) are about to be released very close to each other

Depending on how complex your tables are you may find that it'll cause too many problems to use ORM as they usually require your tables to be structured in a certain way.

Matt