Php frameworks

Associate
Joined
19 Jul 2006
Posts
1,847
Just looking for thoughts on this. I have never used a framework in any of my projects. It's been a while since I have done any php but I want to learn more.

Now I'm thinking of making a web app where different users can log on with different permissions an then add records to a database and run queries from a database from a web front end. Would it be worth experimenting with a framework for this?

Thanks
 
In my opinion the main 4.

Zend http://framework.zend.com/ is the big and popular one, the chaps that build it also build the Zend engine that runs PHP now days (from 4 onwards) so they know what they're talking about. It's also pretty widely used in commercial environments if you're planning on applying your skills in the direction and you can do also sorts of wildly recognised qualifications to do with it.

Symfony - http://en.wikipedia.org/wiki/Symfony Another big one, used on several large sites, very versatile and comes with lots of features already included, loads of developer aids and JS libraries. Very much a large scale framework for larger sites and competitor to Zend.

CodeIgniter - http://codeigniter.com/ My personal favourite. Not as comprehensive as Zend but plenty powerful enough, a damn site quicker to learn, plenty of add-ons and unlike other frameworks doesn't come with a stupid console you have to use. Dubs itself as the lightweight framework which it is but don't take that to mean underpowered take it to mean quick, it's also developed by a company so it's always polished and well supported. Found in professional environments as well and would be recommendation.

CakePHP - http://cakephp.org/ Very similar to CodeIgniter except done by a load of individuals rather than a company. Has a console for quick scaffolding if you like that sort of thing. Would say it's not quite as wildly used in commercial environment as CI and on a personal note I've never liked how they lay their documentation out, I find it hard to work with.


Personally I'd start on CodeIgniter for any sort of smaller project (by small I mean not an international website, not a 4 page static site) and build a CMS with it or something, then once comfortable with that move on to Zend.

PS Once you know your way round CodeIgniter, don't bother building a new admin each time just use http://cibonfire.com/ a pre-built shell.
 
Have a look at Laravel, Lithium or Fuel. All are relatively new frameworks and take advantage of some newer features of php 5.3+.

I have used Zend in the past and was never a big fan. They have a lot of documentation and info about it but it is considered rather slow in the grand scheme of things and php frameworks have moved on quite a lot since the Zend framework was created.

There are various types of framework so decide what type of project you are likely to be using it for in the future and decide based on that. Some are packed full of features, others take a more minimalist approach. Some follow strong conventions whilst others favour configuration.

edit: Zend 2.0 is finally out so I would take a look at that as well.
 
OK so I have started looking at codeIgnite as there's tutorials on nettuts+

i have never done any of the MVC stuff before but I think I am understanding it.

But before I go to far down the line and realise I cant do what I want to do.
Can I check. In codeIngnite there is the database config file where you put the username database and password and then then everything is handled for you.
1. how secure is this?
2. What if I want different users to have different permissions?
 
OK so I have started looking at codeIgnite as there's tutorials on nettuts+

i have never done any of the MVC stuff before but I think I am understanding it.

But before I go to far down the line and realise I cant do what I want to do.
Can I check. In codeIngnite there is the database config file where you put the username database and password and then then everything is handled for you.
1. how secure is this?
2. What if I want different users to have different permissions?

You can setup multiple database connections in the config file and access that db by
$this->DBNAME = $this->load->database('DBNAME', TRUE); in your constructor.
 
I've been using Silex for my current project and found it to be great. It's got great documentation, and is built out of Symfony 2 components.
 
Im doing my project in codeignite just because there are tutorials on nettuts that cover most of the stuff i need to do.

But its a lot easier then doing it in bog standard php.
 
Im doing my project in codeignite just because there are tutorials on nettuts that cover most of the stuff i need to do.

But its a lot easier then doing it in bog standard php.

CodeIgniter's documentation is pretty damm good IMO. The forums also have some pretty good libraries too.
 
The only problem I had was the tut was for version 1.7 and I'm using 2.3??
So class blah extends model does not work it's changed to CI_model but other than that it looks straight forward not that I have done anything to tricky with it yet
 
Just remember, thin controllers, fat models. Most of your application should reside in models (unless it does very little data processing or work).
 
Symfony2 is now my framework of choice, CodeIgniter is still good but showing its age now compared to new frameworks designed to take advantage of PHP 5.3 features.

Daz
 
emm from the tuts I have been doing the controllers are longer than the models.

Can you give in laymens terms what the difference is since they both contain functions.
I understand the view bit thats just putting it all together and displaying it.

In my example I have a function called create_member() one of these is in the model and takes the information and puts it in a database but I also have a create_member() function that lives in the controller that vadidates the user input ??


Also I now have a site that people can login to or sign up to with a members only area. With in the members only area I want to allow them to view records from a database and update them. Is it best to make these as new models and controllers just to separate things out?
 
+1 for CodeIgniter but it's been a while since I've developed an app in PHP, so people mentioning other frameworks making use of 5.3's features means I'm going to go take a look :p
 
Use COdeigniter personally as it's fast and lightweight. However, I've been looking at fuelphp a lot lately and am thinking of switching to that.

I personally wouldn't recommend Zend to someone who hasn't used a php framework before.
 
Back
Top Bottom