Agile Web Application Development with Yii 1.1 and PHP5I am a ‘plugged’ person, means that I am constantly connected to the net and being a member of a certain number of social networks and tools (I maybe a weirdo but *no facebook* account) and I am very surprised of the amount of people that are highly interested on Yii and asks information on what is the best way to learn the framework. In order to solve those doubts I would like to put my two cents on this matter by sharing with you what was my learning curve with Yii -this way I do not need to post in every social network I am involved with.
For this post I assume that you know PHP (beginner, intermediate) and some DB skills for whatever the DB Engine you prefer to work with (MySQL, Oracle, etc…)
Yii Learning Guide
When you first arrive to Yii’s website, even though is an amazingly easy to navigate and use Website, you will obviously feel lost and won’t know where to start working with, and this is the most important steps of them all: download and READ its Definitive Guide to Yii. Do not worry if you do not understand some concepts, but you need to read it all, do not let any episode without a look as you will soon understand everything and will get ‘hooked’ by the easiness and magic of Yii. If you prefer not to download it, an online version of the guide is also available. If you are new to MVC, then I also recommend the visit to Larry Ullman’s Learning Yii Series blog.
After the guide, you will have tons of questions to solve and, even though will become a great tool in the future, do not jump immediately on the forum to drop them all. You need to get your hands on a practical example and for that, the demo application of The Yii Blog Tutorial is the perfect playground. It is highly recommended that you have your preferred PHP editor with two projects open: one that is the full demo blog application that comes with the Yii Framework download package, and the practical project that you will create following the tutorial. There are a couple of lines of code that you need to discover in the builded demo application and there are not in the tutorial.
There is also a book, “Agile Web Application Development with Yii1.1 and PHP5“, that takes you step-by-step through the process of using a test-driven development (TDD) approach to develop a real world Web application with Yii, from initial concept through production-readiness. This is another good practical tutorial to follow. If you do buy the book, then I recommend you to subscribe to Yii’s forum and follow this discussion: http://www.yiiframework.com/forum/index.php?/topic/11920-identified-issues/.
If you have reached this far on the article and follow the above steps then you are already amazed of Yii’s power and probably started your first real-world project with the Framework. Real issues and challenges will arise, it is time to find out about Yii’s amazing network of people, register and subscribe to Yii’s forum. Ask and you will be answered, people are so helpful and polite, it is just unreal the response time of this community. If you prefer to get immediate help, then use Yii’s live IRC chat.
Don’t think that your learning curve has stopped here, to be ‘plugged’ to the network is highly recommended, so ‘plug’ your self to the Wiki. Its articles are written by other fellow programmers, it is a programmers-to-programmers experience, and due to the nature of the people that are part of this network, the Wiki grows day-by-day. This is the reason that I am subscribed to its RSS. You can also stay up to date by following any of the next social networks accounts: Twitter, Facebook or LinkedIn
Once you know the ins and outs of the Framework, one great learning resource are the Extensions written by other programmers. Use them in order to easy your tasks and solve your problems but also read at its guts, its code behind. You will be surprised on how much you can learn from that. If you do not understand something within that code, have *always* a browser window or a tab opened with Yii’s Class Reference.
If you are comfortable with PHP, then I also recommend that you look at the code of the Framework. For example, if you wish to display a radio button using CHtml::radioButton look at the function itself too. Lots of forum questions wouldn’t be posted if they follow this simple advice.
There are other resources to take into account (resources directly extracted from Yii’s site):
The Yii cheat sheet, created by Sebastián Thierer. This presents commonly used Yii classes, methods and properties in a single printable sheet.
Yii 1.1 validator cheatsheet: created by schmunk. This summarizes all of Yii’s built-in validators in a single printable sheet.
The Yii Playground is a community-contributed demo application that uses the PHP Yii Framework to show some features of the framework by explicit example. It is great place to see how some of the features work, and learn the code behind them.
Yii Radio Podcasts, created by Imre Mehesz, covers hot topics and recent activities about the Yii framework.
The community-driven wiki page Yii Related Sites is collecting links to sites with useful tips and tutorials related to the Yii Framework.
The most important thing is that, once you get your hands on this amazing framework you get actively involved in the community (Forum, Wiki, Extensions), and share your projects so others can look at Yii’s real power and provide you with positive feedbacks.
I truly hope this article provides you with an easy guidance to get into Yii’s framework.