Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a PHP Framework?

Tags:

php

frameworks

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?

like image 862
Chris Bier Avatar asked May 08 '26 02:05

Chris Bier


2 Answers

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.

like image 134
Anthony Avatar answered May 10 '26 15:05

Anthony


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).

like image 28
troelskn Avatar answered May 10 '26 16:05

troelskn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!