Studying the framework ¶
Start studying the MVC pattern. You will understand the roles of the model, the view and the controller and know where goes each part of the code.
Read the guide. It is the most important step in learning Yii. A few tips:
- Click on the links throughout the guide, especially the links to the API documentation.
- Explore the API and click on "show" to see the code behind the methods.
Explore the API documentation. See the relationship of the classes, how they extend and are extended by each other and how they are organized in packages.
Very important classes (check them and their extended/extending classes throughly):
Explore Yii's website. There you'll find:
- The demos.
- The extensions. You can browse by categories, by rating or by the number of downloads.
- The wiki (here!), a great source of information about the framework. You will find great articles when sorting by rating, by views, and by comments.
- The forum. A great resource to meet people and learn more about the framework. Create an account there and you'll be able to post your questions.
Then, you can start a fresh Web app project to do anything you want to learn the framework. I suggest that you read the framework's source files and follow the execution path of the methods you call. You'll learn a lot about how it works internally. This knowledge will prove very useful in the future, trust me.
Selected wiki articles that will help you hit the ground running:
- Yii for beginners
- Guidelines for good schema design
- NetBeans IDE and Yii projects
- Configuring PhpStorm IDE for Yii
- The directory structure of the Yii project site
- Relations: BELONGS_TO versus HAS_ONE
- By Example: CHtml
- Understanding the view rendering flow
- Understanding "Assets"
- Understanding Virtual Attributes and get/set methods
- Using Yii with Nginx and PHP-FPM
- Url: hide index.php
Selected extensions that will help you get started quickly: