How to learn Yii?!

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. If you'd like a book, I recommend Larry Ullman's books. Some people learn PHP from the PHP manual. Two web tutorials can be found on webmonkey and home&learn.

  2. Learn OOP

    You need to know the basics of how Object Oriented Programming works. Same as above: use Google or buy a book. You need to read the PHP manual on OOP. It will take you a few hours. Another tutorial about OOP can be found here, and a video tutorial here.

  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 general MVC article on Wikipedia and details of Yii's MVC. You can also find an article here about Understanding MVC.

  4. jQuery

    I highly recommend reading (or even rereading) the Getting Started with jQuery page from jQuery.com. These are some basics you need to know, since Yii uses jQuery as well. If you want to dive more into jQuery, I added some more links at the Extra's at the bottom.

  5. API pages

    The following is important to always remember: You always need to open the API pages on functions you're using. The descriptions of all functions of a language can be found here. The API docs are your memory, since your brain can't remember it ALL. ;) For PHP, use the search box on the top right of PHP.net. For jQuery, you can search the jQuery Docs. And here is the API for Yii 2.0 which has a search feature.

YII

  1. The Definitive Guide to Yii

    The Definitive Guide to Yii is the central and most important learning resource for Yii. It is definitive and was written by the core Yii developers. Just walk through all pages from top to the bottom. Tip: Also check out the comments on the bottom of the pages.

  1. Doing stuff

    At some point while you read the Definitive Guide you'll want to get started with coding in Yii. If you begin with the conventional starting point then you stand a better chance of getting help when you need it. Install the Yii2 demo application. Follow the instructions in the README of those apps to install. Then study the code and start experimenting.

[Note: Stick to the basic app for learning. The advanced app adds a lot of confusing complication for team development and multiple websites in one project.]

  1. Got confused what's happening?

    Learn to use the Debug toolbar and debugger. With the debug toolbar you can view what's going on behind the scenes. It exposes your app's configuration, requests and responses, database queries, and a lot of other key information.

WHAT THEN?

  1. Extra's

    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. jQuery

    Yii uses a lot of jQuery javascript. You really need a basic~good understanding of jQuery for the things you go up against. You can find an elaborate tutorial here, and a jQuery for Beginners video tutorial can be found here.

  3. Community

    If you have questions, head towards the Community forums or the irc chatroom at #yii on irc.freenode.org.

  4. 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.

  5. Return ... to the Source

    To really understand Yii and use it most effectively, get into the habit of reading the Yii classes themselves. They are just PHP code that becomes part of your project. They are written using a simple, clear and consistent style. Remember to return to the source.

Basics - can take days, weeks or years. ;) 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

[Updated by thefsb/tom[] Feb 2015]

17 0
21 followers
Viewed: 93 746 times
Version: all
Category: Tutorials
Written by: yJeroen
Last updated by: CeBe
Created on: Nov 8, 2011
Last updated: 8 months ago
Update Article

Revisions

View all history

Related Articles