Yii 2 For Beginners

I’ve been studying the PHP framework scene for the last 3 years in depth. I’ve done comparisons on all the major frameworks, including Laravel, Symfony, and Yii, and in the end I chose Yii 2 as my framework of choice. You can see a little of the history of this, my blog, Yii 2 vs. Laravel, talks about discovering Yii 2 when it was only in Alpha. After trying all of the other frameworks, watching countless videos and reading many books, I settled on the one PHP framework that had no book whatsoever to help beginning programmers.

I always felt, if only there were a book for beginners, I could learn this quickly, I just needed someone to point the way. Instead, I learned piecemeal by gleaning tips from the forum, the guide, and from the fact that the framework was very intuitive. Even though I made progress, I still found myself wishing for the book. Learning this would be so much easier, if I just had a book!

How ironic is it that 6 months later, I end up writing the book I yearned for? Well, I kept very detailed notes on my development and I noticed over time that I could organize them into a book. I just had to be willing to sacrifice the time, which could have been spent developing actual sites, which instead had to go into writing lessons for other people.

It was a tough choice, but I chose to write the book, it seemed like a worthwhile endeavor. It turned out to be an incredible challenge. It pushed me mentally and physically. I spent long nights picking apart every detail, striving for excellence and clarity, so that others could more easily understand how to use Yii 2.

I started out fairly objective about PHP frameworks, simply looking for the easiest framework that could support robust development. Although I had a lot of respect for Symfony, I felt it was overly complicated and bloated. I didn’t like having to learn Yaml, even though it’s not difficult. I didn’t like having to write every route through the site. I didn’t like what I saw of doctrine. And I didn’t like the fact that alhough they had beautifully written documentation, there was no real effort made to service beginning programmers. This has a downside for businesses that have to hire programmers because it then becomes more expensive to train programmers. So in that sense, Symfony is an expensive discipline.

Laravel, on the other hand, went out of it’s way to service beginners and I loved that about it. The problem was, I just never felt like they were helping me build anything. None of the examples I found at the time, for example, dealt with a robust user login and verification. And without that, what kind of site do you have? And then, because it’s built on top of Symfony, it brings in Symfony’s bloat and performance issues. The other programmers at my company didn’t like it either. It didn’t seem robust enough to them, though in fairness, I should say that it was very new when we were doing those comparisons.

I turned to Yii 1.1.14 because my company had settled on it and the programmers loved it, but I found it difficult to grasp personally. In retrospect now, since I came up to speed on Yii 2, I understand 1.1.14 a lot better, but at the time, it seemed so difficult to use. The reality was that it was difficult to learn, but easy to use. You just had to be at a certain level as a programmer to get that. I hated that about it.

Then I discovered Yii 2 and everything changed. Whereaas Yii 1.1.14 was old and ugly, using old array syntax, no namespaces, etc., Yii 2 was a beacon of modern PHP. And being beautiful architecturally in this case is not just a superficial thing, it is extremely versatile and useful, way more intuitive than it’s predecessor. I have so much enthusiasm and passion for it, that I want to share it, and this was one of the motivations to write Yii 2 For Beginners.

Also, I know that right now, a beginning programmer is wandering around, wondering how to go from novice PHP programmer to framework developer. That’s a tough transition to make. I know just how frustrating it is. I want to help.

There are many, many, more advanced, and more qualified programmers than me, who apparently don’t have time or the interest to bring it down to the beginning level, so that task has fallen to me, at least in the short-term. I didn’t plan for this to happen, I’ve just found myself in these circumstances. There is no other beginning Yii 2 book out right now. So I did the best I could and I put a lot of effort into making Yii 2 as understandable for a beginning programmer as possible.

I realize that by being so into Yii 2, I no longer have objectivity to the other frameworks. That was bound to happen. I had to pick one. And when I get into something, I go all in.

So Yii 2 For Beginners is out now. I’m really glad I could contribute something to help beginners harness the potential of Yii 2, it really is an amazing framework.

Now that the book is done, I’m looking forward to getting back to application development, I hope to have a new site done in January. After that, I’m going on vacation, if I’m still breathing…

I will continue to support PHP and Yii 2 beginners on this blog, and hopefully continue with the polls, which people seem to find interesting. Over 1000 developers have voted in my polls. I hope to continue to develop this blog as a resource for the community.

Advertisements

4 thoughts on “Yii 2 For Beginners”

    1. Thanks so much Alex. I hope you guys like it. I did my best to help beginners understand the basics of the framework and to help them stand up a version of the advanced template. My goal is to make it as accessible to as many people as possible. Any suggestions from the you and team are greatly appreciated, thanks again for creating such an amazing framework.

    2. Hi Alex,
      I am not working in yii frmaework, instead i am a ROR developer. but due to my love towards PHP i started learning yii1.x as my hobby.

      After hearing much from my friends circle about yii2.x release, i am really interested to learn yii2.x

      Came across this blog while googling.. waiting for your review about this book.. i am not sure whether this book will this cater to my needs, which is primarily learning yii2.x and using it in some of my charity projecs..

      Thanks,
      Sitra

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s