Difference between #10 and #15 of
How to learn Yii?!

Revision #15 has been created by fsb on Oct 30, 2014, 2:32:49 PM with the memo:

typo
« previous (#10) next (#16) »

Changes

Title unchanged

How to learn Yii?!

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

tutorial, tips, understanding, yii

Content changed

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](http://www.larryullman.com/books/php-for-the-web-visual-quickstart-guide-4th-edition/).
 
    Some people learn PHP from the [PHP manual](http://php.net/manual/en/).
Two web tutorials can be found on [webmonkey](http://www.webmonkey.com/2010/02/php_tutorial_for_beginners/) and [home&learn](http://www.homeandlearn.co.uk/php/php.html).
 
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](http://php.net/manual/en/language.oop5.php). It will take you a few hours. Another tutorial about OOP can be found [here](http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/), and a video tutorial [here](http://www.killerphp.com/tutorials/object-oriented-php/). 
 
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](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), [two](http://www.yiiframework.com/doc/guide/1.1/en/basics.best-practices) and [three](http://www.yiiframework.com/doc/guide/1.1/en/basics.mvc). You can also find an article here about [Understanding MVC](http://www.larryullman.com/series/understanding-mvc/).
 
4. **jQuery**  
 
I highly recommend reading (or even rereading) the [Getting Started with jQuery](http://docs.jquery.com/Tutorials: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's memory can't remember it ALL functions of ALL programming languages. ;) For PHP, use the search box on the top right of [PHP.net](http://www.php.net/). For jQuery, you can search the [jQuery Docs](http://docs.jquery.com/Main_Page). And here is [Yii's APIthe API for [Yii 1.1](http://www.yiiframework.com/doc/api/). and for [Yii 2](http://www.yiiframework.com/doc-2.0/index.html), both of which have a search feature. ***YiiII*** --------- 1. **Easy introduction**  
 
V

 
 
For v
isual explanation is the best! So check thof Yii 1.1 there are [screencasts](http://www.yiiframework.com/screencasts/). :) After that, read up on [Larry Ullman's easy tutorial series](http://www.larryullman.com/series/learning-the-yii-framework/).
 
2. **The Guide!**  
 Larry also has a video presentation: [Faster Web Development with Yii Framework 2](https://nomadphp.com/2014/07/25/october-2014-us/).
 
 
2. **The Definitive Guide to Yii**
 
The [Definitive Guide](http://www.yiiframework.com/doc/guide/1.1/en/index) 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._  After that, I recommend reading this tutorial: [Under the Hood of Yii’s Component Architecture](http://phpmaster.com/yii-under-the-hood-1/)
 
3. **Doing stuff**  
 
Okay, now you should actually get your hands dirty! Either grab the [Yii Agile Web Application Development](http://www.packtpub.com/agile-web-application-development-yii11-and-php5/book#in_detail) book, or
 to Yii is the *central and most important* learning resource for Yii. It is *definitive* and was written by the core Yii developers. It is available for [Yii 1.1](http://www.yiiframework.com/doc/guide/) and [Yii 2](http://www.yiiframework.com/doc-2.0/guide-index.html). 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**
 
 
At some point while you read the Definitive Guide you'll want to get started with coding in Yii. If you begin with one of the conventional starting points then you stand a better chance of getting help when you need it.
 
 
- For Yii 1.1,
do t[The [Yii Blog tTutorial](http://www.yiiframework.com/doc/blog/). (Or both!) _Note: If you read the book, make sure you check the errata [here](http://www.yiiframework.com/forum/index.php?/forum/38-agile-web-application-development-with-yii11-and-php5/) and [here which takes you setp-by-setp through all the basics of implementing a web app with Yii. Yii 2 does not have an equivalent tutorial *yet*.
 
- For Yii 2, there are two demonstration applications: [basic](https://github.com/yiisoft/yii2/tree/master/apps/basic) and [advanced
](https://www.packtpub.com/agile-web-application-development-yii11-and-php5/book). Also, this book uses Yii 1.1.6. The book takes you on a tour to make an issuemanagement system. Some bits don't work with later versions of Yii, so make sure to use an older version while learning Yii using this book._github.com/yiisoft/yii2/tree/master/apps/advanced). Follow the instructions in the README of those apps to install. Then study the code and start experimenting. 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&How to log and debug variables using CWeblLogRoute](http://www.yiiframework.com/wiki/114/how-to-log-and-debug-variables-using-cweblogroute) Irreplaceable for everyone to see whats happening! This is the best trick you ever learn:   
```php 
>

 
     
Yii::trace(CVarDumper::dumpAsString( $var ), 'NAMEOFYOURTRACE'); ```
 
 
 
***Yii2***
 
---------
 
1. **The Guide 2.0!**  
 
The [Definitive Guide 2.0](http://www.yiiframework.com/doc-2.0/guide-index.html) is very helpful! Just walk through all pages from top to the bottom.
 
***WHAT THEN?*** ---------------- 1. **Extra's**  
 
There are a lot of good tips for Yii 1.1 in the [Yii Application Development Cookbook](http://yiicookbook.org/). (If you buy it, check the errata section on their website.) Also check out the [Yii Wiki](http://www.yiiframework.com/wiki/) and the [Yii Class Reference](http://www.yiiframework.com/doc/api/). _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](http://jqfundamentals.com), and a jQuery for Beginners video tutorial can be found [here](http://net.tutsplus.com/articles/web-roundups/jquery-for-absolute-beginners-video-series/).
 
3. **Community** 
 
  If you have questions, head towards the [Community forums](http://www.yiiframework.com/forum/) or the [irc chatroom at #yii on irc.freenode.org](http://www.yiiframework.com/chat/).
 
4. **More tools**  
 
There are a lot of [extensions](http://www.yiiframework.com/extensions/) for Yii. These are extra "toolboxes", made by the Yii community, that you can re-use in your applications.  
 
1. **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](http://youtu.be/JlPrQS0BNRc?t=4s). 
---   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[] Oct 2014]
 
17 0
21 followers
Viewed: 118 942 times
Version: all
Category: Tutorials
Written by: yJeroen
Last updated by: CeBe
Created on: Nov 8, 2011
Last updated: 4 years ago
Update Article

Revisions

View all history