View Full Version : what is framework . why is it useful

05-01-2008, 07:39 AM
Very basic question , googled for it , but could not get the information i wanted.

There are so many frameworks like cakePHP , codeigniter , Zend.

What is the use of these frameworks . what things can be done with them which otherwise are difficult to do with simple php.

i want to know the examples like

if i do AJAX then by DOM methods i require 30 lines of code but if i use Jquery or prototype it will take 3-4 lines . So there i can feel the difference.

can anyone give me the examples with respect to PHP so that framework makes work easier . and which framework should be used . Difficult to choose

05-01-2008, 11:07 AM
Frameworks save development time. They can abstract out functionality which means you can re-use code a lot more.

For example if there is a PHP based framework that handles user authentication on a website it can simplify things. I wouldn't need to handle talking to the database and doing the authentication myself. And then if I wanted to check the authentication status of a user or their access level for a particular resource, I can just call functions that are already in place that handle all that. Additional when you abstract functionality like that it can be easier on running down programming errors, more so when you aren't on the web platform, if the code behind the framework is battle tested and known to be extremely reliable.

05-01-2008, 11:16 PM
Think of it like this, lets say you build cars. You could build every piece like the casing, engine, axes, etc from scratch. OR you could buy the pieces already put together so you only need to fit together a few pieces to make it work.

05-01-2008, 11:22 PM
using a framework is like buying a fastfood to eat a sendwich, but I agree is faster and easy then cooking. :)


05-02-2008, 01:44 AM
which framework should i use . As i haven't studied any , so i want to have your opinion.

05-02-2008, 02:19 AM
which framework should i use . As i haven't studied any , so i want to have your opinion.

Depends what you want to do.

05-02-2008, 02:25 AM
Depends what you want to do.

It means for every requirement there is different Framework?

I want the simple PHP Framework to build mysql based websites. Is there any thing more specific requirements for frameworks.
I searched internet and found Codeigniter. Is the good . My friend has book on it so will be easy to start with. But someone knows that some other framework is better than i will go for it

05-02-2008, 04:28 AM
Depends what the website is going to need to do.

There probably aren't many PHP frameworks just for mysql support since you can just use the mysql functions in PHP directly if thats all you want. But if you want to build websites with a CMS (as an example) that uses a mysql database, then you'll find stuff.