Overview
In this tutorial I’ll show you in about 30 minutes how to do a basic setup of CakePHP and read some data from the database without writing any SQL! This will be an i-don’t-know-how-many-parts tutorial, but I’ll try to add every week a few until the basics are covered!
In this tutorial I’ll be covering
- Explain CakePHP
- Explain MVC in a nutshell
- Download and setup CakePHP
- Create a database table
- Create a Model, View and Controller
- Query the database without writing any SQL
- Visualize the returned data in a view
Let me know if you enjoyed it!
At this moment I have 4 parts written out, but if you want me to talk about something I didn’t cover in the tutorials, just ask it via the comments! I hope you’ll enjoy it, because coding is awesome, right!?
52 Responses
You are doing great. This tutorial will be helpful to beginners. Thank you. Keep doing.
thanks! i’m very happy to hear you like it!
can you teach about change layout ?
Thatâs great, Thanks for this tutorial.
That’s great, Thanks for this tutorial. Can you help me my friend?
I can’t config mod_rewrite. I’m really happy for this help.
& I hope you will reply for my question.
Thank you!
what’s the problem exactly?
Good one.. Please continue to do your video tutorial
I’m kinda new to programing with mamp and php, where exactly is your tutorial directory, currently i’m a only getting the “it Works!” page from local host and none of the cake php. And when I do put the cakephp Folder into the WebServer/Documents/ only the directory shows, not the cake php website.
Do you know what i am doing wrong?
this was really great, the best cakePhp tutorial I found, and got me up and running, unlike any of the other tuts.
Cool Stuff. You are great teacher! Thx
Hey hie Frederik
i want to know how to apply own external stylesheet in cakePHP
I have already emailed you this question there i have written in brief.
And your tutorial is much useful to me and all beginners over there đ
hey frederic! pls be kind enuf to help me with this, i have no clue where i am stuck
m using ubuntu
i have my app, lib, plugins, vrndors foolder in var/www/cakephp
i had altered my routed file to change the landing page of localhost/cakephp. so now instead of executing pages controller..it says Missing Controller : cakephp controller not found,
on localhost/cakephp/users.php and
localhost/cakephp/users/index.php
its giving 404 NOt found.
this happened immediately after deleting .htaccess files and uncommenting Configure::write(‘App.baseUrl’, env(‘SCRIPT_NAME’)); in core.php
Very energetic post, I loved that bit. Will there be a
part 2?
Thanks Nichol, great to hear you liked it! There are 4 parts, you can find them on this blog. You can find the second one right here
http://blog.the-nerd.be/2012/08/cakephp-basics-tutorial-part-2/
I could install cakephp and get to my new home page alright by following the tutorial. However, /cake_php/users results in a 404 by the web server.
Here is some info about my installation. Im on a bitnami lamp stack. my cakephp_basics app is installed at /opt/lampstack-5.4.15-0/apache2/htdocs/cakephp_basics
Any help would he great. Let me know you need more info from me.
And great tutorial by the way. Saved a tonne of time for me.
Hi again, I figured it out. It was a mod_rewrite issue with my installation.
Thanks for this! It really helped me wrap my head around the way the model, controller, and view interact, and did a simpler and more succinct job of explaining some of the behind-the-scenes things CakePHP is doing. I’m looking forward to watching the rest!
Very nice tutorial for beginners….
this video will be realy helpfull to me
Great post. Good tutorial for people who want to begin learning CakePHP.
Great tutorial, I develop in PHP but its my first time using CakePHP. This is very good.
Gud tutorial for beginners..Can u Pls upload the codes of the Project.
Great tutorial!! This helped me understand how the framework’s components interact with eachother far better than the tutorials on the CakePHP website did.
plz provide some other tutorials as soon as possible as you have provide the first one which is more attractive and easy to learn the basic of cakephp….thanks alot
Great Tutorial. I love it. Thanks much sir.
HiI
Plz, create mail components tutorials.
great tutorial very helpfiull
You have helped me a lot man. Thanks a ton
awesome dude@you doing great work
Great article đ Thanks
I love your tutorial on cakephp. You make it sound so easy! đ
very good sir very good
It was amazing for new learner like me. Thank you so much.
Hello,
Your tutorials are great. I have small doubt in phpstorm. when writing code in phpstorm, the codes did not autocompelete instantaly in .ctp file. But it works well in .php file. Why do not working in .ctp file?. Please help me.
Thanks in advance
Hi, thanks! Really happy my tutorials are helping you out đ
You can add autocomplete in CTP files by assign them to the PHP file types via File -> Settings -> File Types.
Hi! Thanks for the great tutorials!
Heb ze allemaal doorlopen en ben nu bezig met een eigen databank en wou ook alle stappen terug doorlopen maar dan met mijn gegevens.
Ik zit vast als ik ze allemaal wil weergeven op mijn pagina. Ik krijg deze error:
Error: Call to a member function find() on a non-object
Deze files heb ik:
————————-
LoginController.php
class LoginController extends AppController{
public function index(){
$users = $this->User->find(‘all’);
pr($users);
}
index.ctp
Login
Login.php
class User extends AppModel {
}
———————–
$users = $this->User->find(‘all’);
die “User” vanwaar haal je die?
Ik heb het opgelost door de UsersController te gebruiken.
Alleen snap ik nog altijd niet goed vanwaar die “User” komt?
Hi Jonathan,
In een controller heb je toegang tot je model via de User property.
The best php tutorial still i have seen…and i am sure that i won’t get better than this…thanx a lot…:)
very good sir
I searched for hours for a simple tutorial on how to get started with cakephp and this went so far ahead of expectations. Amazing tutorial
Thanks for doing this, Frederik! I was struggling to really understand the concepts of MVC and CakePHP at the same time for a few weeks (on and off trying to prototype my own projects) and finally found this. Very clear and helpful! Thank you!
Great Tutorial Sir.
Still you can use Diagram to explain to help people like me.
Great article thkx man !! u doing well !!!!
Great tutorial!
I have learned the powerful basics shown in this video and help me to solve a problem ofrom one of our website customer that need to migrate his webpage.
Thank you and keep going!,,
I am trying to learn CakePHP. Your fisrt video is amazing and very helpful. I will continue with the others.
Keep going
Apythanos from Hellas
Nice tutorial…thanks admin..
Very clear and nicely explained!
You made it plain and simple!
Hoping to see more for cakephp and more.
Thanks very much!
Thank you so much for this tutorial. This is my very first CAKE video. It was clear & concise.
Great tutorial. You make it so easy to learn CakePHP for beginner.
Many thanks