naike Posted October 14, 2010 Share Posted October 14, 2010 Hey, this is my 3rd topic, only withing a few minutes but since I didn't find a forum that would cover my 2 questions I have in one section, I went ahead and posted them separate to get a fast answer and keep it clean. So, I'm a bit uncertain what a framework does. I watched some CakePhp setup videos to find out what it actually does, but I couldn't find any video that would actually show the framework itself. After reading a couple of definitions for a php framework (CakePhp in particular) I still don't understand what the use is. Someone said it's a tool for programmers to make programming easier. How, that still remains unclear to me. Anyway, my question is, what does a framework do in practice, what are the up/down -sides of using these, and more importantly, should I consider using frameworks as a beginner, could I play around with them? I hope I will get an answer and that I don't appear too spammy Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/ Share on other sites More sharing options...
frizi Posted October 14, 2010 Share Posted October 14, 2010 Your question is right. Many beginners (including me in the past) don't understand what is the advantage of a framework until he has to made his own framework and finds out that there is other framework which is much better than the created. Just think that you have a Content Management System to make. Now you create a program/system which handles the data within MVC pattern. You have to make the controller, model and view to work. Also you want that this system does extra like loging, handling sessions, do something with arrays and so. Now instead of making these functions on your own, you can just take a super duper framework which provides you the necessary functions and instead of experimenting with your own code, you have a ready made system which is acknowledged by a big community and you can be sure that the solution applied within the framework is appreciated by other, more advanced programmers. Sooner or later, you will end at an framework. If you want to make something good for your programmer life and want to stick with PHP, I would advice you to look into Zend framework because everyone is so crazy about it or if you want a soft start, check Code Igniter and read, no really read the help about it. It's one of the best and quickest helps that I've ever seen. I hope that I've succeed to bring you closer to frameworks. If not, a short explanation for frameworks would be that they provide ready made functions which you can use. Ah, disadvantages of the framework are bugs which can be a big threat for each web site that is running on that framework. Therefor I've prefer to make my own functions but use the basic functions of the framework. Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/#findComment-1122284 Share on other sites More sharing options...
Zyx Posted October 15, 2010 Share Posted October 15, 2010 Framework is a website building toolset. You can look at it as a collection of ready-to-use code, design practices and project structure, which you build your website on. Here is a classic example: website is usually divided into separate subpages. The framework gives you a structure to organize your subpages and the code that manages it. If you want to add a navigation to it, you get a navigation component and configure it, and so on. You do not have to write or invent it on your own. It's not a CMS, which is actually a complete web application, where you simply point and click to make a website. Frameworks can be used to write CMS. The question whether to learn it or not depends on your current skills. Frameworks use object-oriented programming techniques, so if you do not know it, you have to learn at least the basics, and some general programming knowledge is also recommended. In PHP it is a small problem, because it's often the first programming language for many people, and to be honest - a complete programming newbie usually has problems with understanding the whole concept. What to use: many people recommend here CodeIgniter, which is something I don't understand; in my country this framework is almost completely forgotten because it uses outdated technologies (PHP4). Instead they often choose its clone, Kohana, rewritten to PHP5. There is also Symfony, ZF, and more rarely - CakePHP. Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/#findComment-1122387 Share on other sites More sharing options...
naike Posted October 15, 2010 Author Share Posted October 15, 2010 Framework is a website building toolset. You can look at it as a collection of ready-to-use code, design practices and project structure, which you build your website on. Here is a classic example: website is usually divided into separate subpages. The framework gives you a structure to organize your subpages and the code that manages it. If you want to add a navigation to it, you get a navigation component and configure it, and so on. You do not have to write or invent it on your own. It's not a CMS, which is actually a complete web application, where you simply point and click to make a website. Frameworks can be used to write CMS. The question whether to learn it or not depends on your current skills. Frameworks use object-oriented programming techniques, so if you do not know it, you have to learn at least the basics, and some general programming knowledge is also recommended. In PHP it is a small problem, because it's often the first programming language for many people, and to be honest - a complete programming newbie usually has problems with understanding the whole concept. What to use: many people recommend here CodeIgniter, which is something I don't understand; in my country this framework is almost completely forgotten because it uses outdated technologies (PHP4). Instead they often choose its clone, Kohana, rewritten to PHP5. There is also Symfony, ZF, and more rarely - CakePHP. Well, I know basic Php, and I've started learning oop now, I'm still learning oop but I get the idea. I want to start building a web project, that I can work on all the time over a long period of time, so I don't want to limit myself in any way. Should I begin working with frameworks? Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/#findComment-1122514 Share on other sites More sharing options...
Zyx Posted October 17, 2010 Share Posted October 17, 2010 If you have some knowledge about OOP and understand such terms, as "design patterns" and what they are used for, you can give them a try. In fact, it is possible they could learn you some good OOP design techniques. Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/#findComment-1122896 Share on other sites More sharing options...
Grandioso Posted October 19, 2010 Share Posted October 19, 2010 I'm currently working on a project and I thought about using a framework. There are 4 static pages and a simple e-shop. I started thinking about it after a friend told me he used cakePHP and he really liked it. Which FW would you recommend ? Which one has the best perspective (I don't want to waste time on some PHP4-based crap) ? Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/#findComment-1124127 Share on other sites More sharing options...
ignace Posted October 20, 2010 Share Posted October 20, 2010 Kohana, Yii, Symfony, Solar, Fuse, Akelos, .. (all PHP5) I have already used Zend framework, CakePHP, and CodeIgniter and I am currently digging into the above frameworks. 22 Open-Source PHP Frameworks Quote Link to comment https://forums.phpfreaks.com/topic/215885-general-framework-question/#findComment-1124317 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.