tags:

views:

335

answers:

4

I'm very new to programming (besides SQL and databases), but I ultimately want to master Cake PHP for web development.

Now, given how new I am, I'm rather lost as to how I get started. Down the road, I want to use MVC framework so that I help myself be disciplined in the way I build. However, I know basic knowledge of PHP and OOP PHP are required. So my question is this: what are the right steps to mastering Cake PHP? I don't want to skip critical phases of learning before learning to Cake PHP. At the same time, I don't want to spend more time than required learning PHP if I can learn it directly through Cake PHP knowledge.

Any advice would be appreciated.

+1  A: 

For a start, use the Cookbook

Although, I'd strongly suggest getting familiar with PHP itself first - any introductory level PHP book should suffice.

K Prime
+9  A: 

IMHO you should be comfortable writing at least a basic app in clean standard procedural code before using a framework. That means mastering all the basic elements of the language like if and switch, loops, functions, local and global variables, etc. It also includes being comfortable with HTTP GET and POST, RESTfulness and how to persist information between page loads (Cookies, Sessions, URL params). A basic idea of Javascript and AJAX would help as well.

Good exercises might include:

  • A page that outputs database contents and is paginatable, filterable and sortable by various fields.
  • A shop checkout process or similar "wizard"-like page.

That's when you can pick up a framework, since most frameworks abstract exactly these kinds of tedious things away from you. Especially Cake has a lot of automagic built in, which will leave you hopelessly confused if something goes wrong and you have no knowledge of the above mentioned. To start with OOP, you might want to try something like Zend first, which is a lot more transparent in how objects are used.

deceze
Definitely good advice. You can try to learn enough to get by and piecemeal something together, but you'd be better off learning the basics, then going back and utilizing the framework better, because you'll be more comfortable with what's going on.
Jeremy Morgan
Thanks for the advice guys
Hiro
+1  A: 

Deceze gives good advice, though I disagree that REST is a core concept for learning PHP. You can author a perfectly successful web app that isn't using the concept at all, and I don't think that you'd be hurt by learning it along with a framework.

The rest of his advice is good, however, and, so that you aren't out there on your own just crawling the web, I heartily recommend PHP and MySQL for Dynamic Websites by Larry Ulman. It won't teach you (much) about OOP, but it will give you a very solid foundation in PHP and MySQL, as well as how the two play together. More importantly, you'll cover a lot of core programming concepts applied to practical examples in PHP. This book was fundamental in my development as a programmer, providing baby steps and advanced techniques that made it a lot easier for me to digest more complex topics later on.

Brian Warshaw
Well, big parts of REST are a stateless server and a server-client architecture, and those are important points to understand. While REST in all it's philosophical implications (verbs, nouns and so on) is indeed not really necessary to know, whenever you are authoring a *web app* you're always, by definition, using REST.
deceze
What I was basically trying to say: REST == how the web works.
deceze
A: 

This one was by far the most useful for me

Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition http://www.sitepoint.com/books/phpmysql4/

It went through all the basics in a very logical way, and then challenged you to take some first steps on your own.

After reading this book, I'm at the same point. Whats the next step to understanding OOP, and implementing a framework like Cakephp...

Evan