Changes
Title
unchanged
How to learn Yii?!
Category
unchanged
Tutorials
Yii version
changed
all
Tags
changed
tutorial, tips, understanding, yiiunderstanding,Yii,tutorial,tips
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[general MVC article on Wikipedia](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), [two and [details of Yii's MVC](http://www.yiiframework.com/doc-2.0/guide/1.1/en/basics.best-practices) and [three](http://www.yiiframework.com/doc/guide/1.1/en/basics.mvc-start-workflow.html). 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 2.0](http://www.yiiframework.com/doc/api/).
***YII***
----------2.0/index.html) which has a search feature.
YII
===
12. **Easy introduction**
Visual explanation is the best! So check the [screencastsThe Definitive Guide to Yii**
The [Definitive Guide to Yii](https://www.yiiframework.com/screencasts/). :) After that, read up on [Larry's easy tutorial series](http://www.larryullman.com/series/learning-the-yii-framework/).
2. **The Guide!**
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 grabdoc/guide/2.0) 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._
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 the conventional starting point then you stand a better chance of getting help when you need it. Install the [Yii Agile Web Application Development2 [demo application](https://www.packtpub.com/agile-web-application-development-yii11-and-php5/book#in_detail) book, or do the [Blog tutorial](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](http://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._
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](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');
```
***WHAT THEN?***
----------------
1. **Extra's**
There are a lot of good tips 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.
---
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,
Jeroengithub.com/yiisoft/yii2-app-basic). 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.
4. **Got confused what's happening?**
Learn to use the [Debug toolbar and debugger](http://www.yiiframework.com/doc-2.0/guide-tool-debugger.html). 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](http://www.yiiframework.com/wiki/) and the [Yii Class Reference](http://www.yiiframework.com/doc-2.0/index.html). _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[] Feb 2015]