Benefits of using cakePHP? [closed] - php

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I know PHP well. But i haven't tried cakePHP before and i was willing to learn cakePHP. So just want to know that is there any benefits of using cakePHP over PHP?
Thanks,
aby

cakePHP, like CodeIgniter, FuelPHP and Symfony (just to name a few) are frameworks. What this means is that they have tried to abstract some of the normal, every-day things you do in development in an effort to speed up development time and make you more profitable.
In today's world, there is no excuse for not using a framework. If you refuse to use a framework, you find yourself creating a lot of the things that a good framework provides anyway (i.e. data abstraction layers, session classes, form validation, etc). By using a framework, you not only gain time, but you gain stability as the different components of the framework should be designed to work well together and have been thoroughly tested by the community.
Whichever framework you choose is up to you and hopefully now you understand it's benefits.

CakePHP is an MVC framework that will allow you to setup your data model and connect it to a database to be easily manipulated in PHP. It also allows you separate your business logic from your display logic using a controller.
It also gives you a lot of useful functionality like authorization, sessions, form validation, pagination.. for free. You should check out the feature list.
If you didn't use CakePHP you would have to roll your own framework, which is a lot of extra hassle and work. There are of course other frameworks.

The answer is pretty simple, it comes down to your need's, do you need a framework?
You say that you know php well, i doubt you know it as well as you think as you would not ask a question of this nature, you would understand the concepts behind a framework.
You say:
So just want to know that is there any benefits of using cakePHP over PHP?
it's not a language sir, it's a framework that supplies the PHP foundations for an application, why would you not wan't to use such a thing, what you should be asking is:
What's the best framework to learn once you have mastered PHP Fundamentals.
But don't ask it here, there are plenty of posts that answer that question for you.

CakePHP is an MVC framework But to simply say you need to design the data models and relationship (creating necessary tables) before start the work , once you use bake command 70% of coding are given

Related

Easy way to locate related files in PHP project [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am a core PHP developer and learning MVC Frameworks: CodeIgnitor and Kohona. I downloaded few sample projects to do research on how they work. I am really confused how to determine which Model, which View and which Controller are interrelated to each other.
How can I easily locate which View is for with Controller and vice versa for models, views and controllers.
Also, can anyone tell me what's the major advantage of using these frameworks (Sorry this question to be asked in Google first, I am just looking for short answer) and I feel frameworks uncomfortable cause its hard to locate right file if someone else developed the application.
The right way to find related files in a project is that, you have to read code, for example, if you want to find what view or model is being used in a controller then you should seek in the ode, which model it calls and which view it loads. This is the only way to find related files.
There are lots of advantages to use a framework but one of the most important advantages of using a framework is that, it speeds up development process, writer less do more, it makes your development process faster because it provides you some tools, for example, a Session class for session management, a Validation class for user input validation etc, using these tools you can easily make an application with a very few code and it saves your time so you become more productive.
Another important advantage is that, if you are working in a team and use a framework then each developer knows the code organization of the project because the framework ties everyone to a single set of rules that every developer must follow, everyone follows the same conventions so there is no confusions and any time you may add more developer to work on a project who knows the same framework and can work without any problem.
CodeIgniter and Kohana does not implement MVC (even if they say so...).
A typical flow in php frameworks that call themself MVC are : A url routes to a controller, the controller retrives data from model and passes it the view.
The advantage to using a framework should be that it provides a set of tools for rapidly development, making you focus on the unique code for your application.
The documentation for each framework should be pretty straight forward, you should read it if you going to use a framework...

Startup building and mokup [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
since about two years ago, I did find my interest in code (Hardware/Sytems/Web) and now, I've found a project which motivates me a lot (It takes all my free time indeed).
Starting this point and because my project could soon switch from a free time project to a daily job, I'm currently developing a mockup of this project based on PHP/MySQL and JQuery.
Even if I'm a true Python/MongoDB lover and a System Engineer, I did prefer those technologies to build up my mockup because of their simplicity to build a complete functional private stack at home.
I'm pretty advanced on my mockup and it seems to work as I want it.
Now I'm wondering if, about your point of view, would have been better to start to build my mockup using directly the targeted technologies (Python/MongoDB) rather than to use the easy PHP/MySQL couple to do it?
Obviously, because I plan to made this project my daily job, I had to have something visually functionnal to be able to raise a little bit of money, and about me, using an easier stack it's more easy, but I would like to have your feedback on this kind of question.
The idea that PHP/MySQL is easier or simpler than say Python/MongoDB is just inconsistent.
If you compare for example, Django (the most popular python web framework) with symfony(PHP) you will find that they are almost identical in terms of features and architecture (symfony is actually slightly more complex but also has more very advanced features).
For mockups, if I were you, I would use solely HTML/jQuery/CSS.
Build your pages just like you would like to have them in your beta version, use jQuery to load sample data written in json.
That's all you need. You can even find WYSIWYG application to speed up the process.
Later on, you can build the back-end application using either python or php, it won't matter.
The integration process will be identical, create your models, create the controllers, and use the HTML you already have as templates.
Building your app in php/mysql then convert it to python/mangodb will make you rewrite almost all the code simply because python is so much different from php (easier I would say too, but that's just my opinion) and because mangodb is not a relational database meaning you will have also to rethink partially your architecture.

What advantage does using a framework like CodeIgniter or CakePHP provide over using 'plain vanilla' PHP? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm new to PHP and am trying to more of an overview before I jump into the code sometime tomorrow.
What advantage does using a framework like CodeIgniter or CakePHP or Zend provide over using 'plain vanilla' PHP?
The framework takes care of the stuff that everyone's done a hundred times - authenticating users, talking to databases, handling file uploads, validating forms.
It saves you time, because you don't have to write it again.
It saves you headaches, because it's probably designed better than you would off the cuff and because it's already been thoroughly debugged.
It makes it easier to collaborate, because anyone who knows the framework has a step up on understanding your program.
It makes programming more fun, because you can focus on writing the interesting bits, not the slugwork.
Any framework has the advantage of solving problems that just about any programmer would encounter without using a framework.
There are many common problems that you and I would face regardless of whether or not we're building software for banking, media, news, etc, and instead of reinventing the wheel, you can springboard off of the hundreds and thousands of hours of developer experience by using code that has been tried and tested in a multitude of different production environments.
The motto is this: Don't reinvent the wheel. Your job is to meet a business goal, not solve problems that other people have already solved for you.
One advantage is: Design decisions are made for you.
One disadvantage is: Design decisions are made for you.

Lightweight MVC - no framework [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Hi sorry if this is a naive question, but what did people do before mvc frameworks became so popular? All you hear of nowadays, and im talking php here, are mvc, Zend etc but what did developers do beforehand?
Are there some developers who use the mvc pattern but without a framework - if so how do they do this and is it really complicated to set up?
MVC is a design pattern. You can easily roll your own MVC "framework" (technically even without using object-oriented programming). The main goal is simply to have a separation between data storage, business logic, and presentation.
When I was first learning about MVC, I decided that trying to sift through the mountains of code of CakePHP or other frameworks was simply too complicated. I started writing my own "framework" using this tutorial (http://fuelyourcoding.com/php-frameworks-just-roll-your-own-part-1/). It's really not as much work as you think (you can go through that tutorial in a day and have a very nice mini-MVC), and you can expand it later into a full-fledged framework later on if you have the time and dedication.
As to the question of what developers did before frameworks, well, they just wrote everything themselves. Unfortunately this led to a lot of spaghetti code with HTML mixed with PHP blocks and SQL statements, but that's not really a fault with not having a framework, rather with not trying to implement any sort of separation of concerns.
Edit: Part 2 is probably the most important part because it shows you how to make a template. This isn't actually the exact tutorial, the one I used seems to have disappeared.

What's the best way to learn mvc in PHP? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm totally new to mvc,how to pick it up?
Go this way:
Read about MVC (Google it, see the wikipedia article)
Choose a Framework (I suggest CodeIgniter - Has a great user guide)
Then go through the user guide and try the things.
The video tutorials are also good, check nettuts.com for CI.
Go this way:
Know what is MVC
Why it is useful
How does it work
Where it should be used optimally
How do frameworks use it (if possible to know)
Learn how frameworks implement it (try using a framework)
Learn a framework so that you can become habituated to using MVC
I know I might sound foolish, but this way can be of great help to newcomers.
Maintain some project written in spaghetti code (CSS + JS + HTML + PHP + SQL, all in one single file), then think how you would separate all these and you'll discover MVC.
Kidding aside. Read about it what you can, try some framework but don't avoid maintenance projects. It is in these projects that you'll see the benefits of MVC or at least those of separation of concerns.
See also this related question.
You can read all about MVC with a simple google search. However, you won't fully understand the beauty of it until you pick a framework and dive in. I hear great things of CodeIgniter. It was my first framework when getting into MVC.
In the end I chose CakePHP. Why? CodeIgniter, while very simple to get started with, gave me too much freedom for a beginner to MVC. I wanted strict rules and conventions to show me how its supposed to be done rather than what I think MVC should be. Maybe later on down the road I'll come back to CI. Either way you choose, my suggestion is to take a small project you coded, and code it in any of the PHP frameworks out there.
CakePHP's and CodeIgniter's communities are among the most helpful. Join a google group for Cake/CI. Read about what people are trying to do. See what problems people are having and good luck!
First research the MVC pattern and look for tutorials that explain how to implement it. Next, get an MVC framework for PHP and use that since there's no sense trying to reinvent the wheel and roll your own.

Categories