robert_gsfame Posted February 12, 2011 Share Posted February 12, 2011 can anyone give me some simple explanation what is actually frameworks, why do we have to use it instead of using pure PHP code. I read some articles that there is dozens of frameworks like code igniter, phpcake, etc....what is the different and which one is the best to be used? thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/227426-what-is-php-frameworks/ Share on other sites More sharing options...
jcanker Posted February 12, 2011 Share Posted February 12, 2011 Basically--and I'm greatly simplifying it here--a framework is a set of custom functions that are intended to shorten your project build time. They have templates for quick use of common projects, ajax functionality to make XML easier, etc. I don't use any frameworks for PHP because I'm stubborn and stuck in doing things the way I first taught them to myself--do what I know and look at the PHP API if I need something I haven't done before, and ask on these boards if I get stuck. Javascript has some great frameworks, in contrast, like jQuery. Since I'm just learning that aspect of things, I'm learning the framework *first* rather than go back and replace what I already know. If you want to take the time to learn a framework, it probably will save you time on a really big project or a lot of projects in the long term. You'll still have a slow start to a project because of the learning curve, but once you know the framework, you'll work more quickly. Does that make sense or did I just ramble? Quote Link to comment https://forums.phpfreaks.com/topic/227426-what-is-php-frameworks/#findComment-1173093 Share on other sites More sharing options...
Philip Posted February 12, 2011 Share Posted February 12, 2011 Frameworks are great for a few different reasons - rapid prototyping of an idea, help keeping that motivation of clean & reusable code going, etc etc. Remember, you don't have to use a framework at all. If you do decide to use one, there is no right or wrong answer on which framework to use. Each one has its pros and cons, and you need to decide which fits your task at hand best. A great resource to compare the features of each framework can be found at http://www.phpframeworks.com/ Quote Link to comment https://forums.phpfreaks.com/topic/227426-what-is-php-frameworks/#findComment-1173310 Share on other sites More sharing options...
Ninjakreborn Posted February 13, 2011 Share Posted February 13, 2011 Frameworks still use pure PHP code. The purpose of a framework, whether it's third party (CakePHP, Codeigniter, Symphony, Zend) or custom build, is to try and make development faster. Even when I am building basic xhtml/css websites with little programming I end up using a framework regardless. If I am not developing something in Drupal, Wordpress or another system then I am generally using a framework. My favorite currently is Codeigniter. Even if I am doing a straight xhtml/css website I do a basic Codeigniter install, and do the coding inside a display class to make things easier to keep up with. Frameworks just make things cleaner, faster, and easier to get around. Generally they provide a slew of useful functions to help make some things faster. Like CI just added the cart class not to many version ago. This makes doing a custom shopping cart a lot faster and more efficient. Little things like that which speed up development. That, coupled with the benefits of MVC, make development a lot faster, more affective, and easier to maintain/update later on down the road. Quote Link to comment https://forums.phpfreaks.com/topic/227426-what-is-php-frameworks/#findComment-1173486 Share on other sites More sharing options...
woolyg Posted February 13, 2011 Share Posted February 13, 2011 Over the past 6 or so months I've gotten into CodeIgniter, and found it's really speeding up my development time. It took me a while to get used to it as I'm not the sharpest tool in the box, but that's where the CodeIgniter user guide comes into play - it's simple and clear, and very easy to understand. I've seen discussions saying that CodeIgniter is not true MVC, and one of the slower of the 'fast' frameworks, but it serves my needs perfectly right now:) WoolyG Quote Link to comment https://forums.phpfreaks.com/topic/227426-what-is-php-frameworks/#findComment-1173535 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.