tags:

views:

160

answers:

2

Ive never heard of this before, and I have been coding in PHP for quite some time. I actually feel kind of stupid asking this question but, what is a PHP Framework? How can it help me? and how do I use one?

+6  A: 

A framework in general is a collection of classes and functions that let you accomplish your goal faster in development. PHP Frameworks such as Symfony, CakePHP, and Zend all have a series of utility classes, tools, and structured elements that let you avoid reinventing the wheel.

Zend Framework, like many, has a strong MVC engine that let's you avoid rebuilding that functionality yourself.

To start using a framework, you download the framework itself. In the case of Zend, I download it, unpack it to lib/, and I'm good to go. From there, you just read the documentation on that particular framework to learn how to actually utilize the tools they provide. What functions to use, what classes where, and so on.

Tony k
Thank you for the prompt response :)
Chris B.
Don't hesitate to throw in some specifics or hypotheticals if it'll help now as well. :)
Tony k
Is it like a jQuery plugin for php?
Chris B.
Chris, not really - Zend does have a new module that does some of this. But think about the implications a jQuery Plugin in PHP - unless it manages all of your javascript, it can get a little messy. The framework overall provides a LOT of features, like access control lists, an MVC subsystem, and whatnot. Things like javascript framework integrations are just one of the little tools that are added in. It's more about providing useful tools and helping you structure your code.
Tony k
+1  A: 

A framework is a big library. Exactly where the two differs, is rather fuzzy, but generally frameworks have stronger implications on workflow than libraries do. A (good) library is passive, where a framework is expected to be more involved. Consequently, frameworks are also often quite monolithic (eg. you can't usually use two frameworks together).

troelskn