How to learn Yii?!

7 followers

Here is a step by step To-Do list for Yii beginners. The list is an advice of what tutorials and documentation you can walk through to get a full understanding of the Yii Framework. These can be a help to learn Yii.


BASICS

  1. Learn PHP
    You need to know how to program in PHP. You can find many tutorials on the web, or buy a book. The Basis/Advanced/Database tutorials from w3schools are a good start. Two other tutorials can be found on webmonkey and home&learn. Tip: Always use the php.net search function for documentation!
  2. Learn OOP
    You need to know the basics of how Object Oriented Programming works. Same as above, use Google or buy a book. Click here for a normal tutorial, or a video tutorial.
  3. MVC
    It is very important to understand what the Model-View-Controller pattern means! If you don't, you will think Yii is chaos. As soon as MVC "clicks" in your mind, you will see the very logical pattern. Read up on one, two and three. You can also find an article here about Understanding MVC.

YII

  1. Easy introduction
    Visual explanation is the best! So check the screencasts. :) After that, read up on Larry's easy tutorial series.
  2. The Guide!
    The Definitive Guide is very helpful! Just walk through all pages from top to the bottom. Tip: Also check out the comments on the bottom of the pages.
  3. Doing stuff
    Okay, now you should actually get your hands dirty! Either grab the Yii Agile Web Application Development book, or do the Blog tutorial. (Or both!) Note: If you read the book, make sure you check the forums for errata.
  4. Got confused what's happening?
    You can trace all variables to the Yii Log to see what's in them. You can find more info here: log&debug vars using CWeblogRoute Irreplaceable for everyone to see whats happening! This is the best trick you ever learn:
>   Yii::trace(CVarDumper::dumpAsString( $var ), 'NAMEOFYOURTRACE');

WHAT THEN?

  1. Extra's
    There are a lot of good tips in the Yii Application Development Cookbook. Also check out the Yii Wiki and the Yii Class Reference. Tip: You can view Yii source code directly in the API docs. Also, the lookup/search box in there is invaluable.
  2. Community
    If you have questions, head towards the Community forums or the irc chatroom at #yii on irc.freenode.org.
  3. More tools
    There are a lot of extensions for Yii. These are extra "toolboxes", made by the Yii community, that you can re-use in your applications.

Basics - Step 1 & 2, can take days, weeks or years. ;)
Basics - Step 3 and Yii - Step 1& 2, takes a few hours.
The rest takes days, or a few weeks if you're doing things parttime. After all that, you should go into the depths of building your own custom Yii stuff!

Have fun with Yiiing!
Kind regards,
Jeroen

Total 3 comments

#5840 report it
jeroen84 at 2011/11/19 05:26am
Thanks for feedback!

Hi Andy,

Ofcourse I should add in the Extensions repository!

Hi Drumaddict,

I never said you should be a php expert. ;) But you do need some knowledge about it. Though, as every programmer knows: If you know how to ride one bicycle, its easy to pick up a different one as well. I'll try to change some of my wordings to reflect that. Thanks!

#5767 report it
drumaddict at 2011/11/10 03:34pm
Disagree on some of your points,good list overall though.

Let me disagree on some of your points.I don't think you need to be an expert in PHP to start with Yii.I came from Adobe's Flex framework to Yii and I had no idea about PHP.OK,so maybe I spent a few days to learn some basics of the syntax,but I don't agree that you have to spent years in learning PHP before you take up Yii. About MVC.I think you can learn MVC in the context of Yii,no need to "take a course on MVC" just to understand Yii's MVC.Just dive into Yii and you'll understand MVC as you go. I agree on 4-7.I think the inportant point is that if you have a programming experience and know the basics of OOP,learning the basics of Yii will be easy.

#5750 report it
andy_s at 2011/11/09 09:42am
Nice

Nice one! Very short and clear.

Though, even if it takes few days/weeks to read Yii guides and stuff, it can take much more time (months) to learn how to solve different problems using Yii, to understand its philosophy and the source code.

Also I think you should mention Extensions repository, because there are many nice & useful components which can help a lot in the process of learning and using Yii :)

Leave a comment

Please to leave your comment.