Where to Start with Yii

If you’re like me, then you came to the Yii framework world with enough web coding experience to take scripts and manipulate them to your needs or even build your own applications from scratch to customize the features you want a site to have. The short story is: that you understand how to program in PHP.

Now I realize a lot of people who get into framework coding actually never learned (from a technical class at least) the art of OOP, heck majority of PHP coders didn’t learn the language from a class either. Myself, I had the opportunity within school to learn OOP with C++, that being said it may be a different language but the concepts are still the same. This is a huge help in working with an OOP framework (go figure?). Now I’m not here to teach OOP, there are plenty of articles out there that have a great sense of pointing you in the right direction with learning OOP. So if you need to catch up on it or haven’t a clue what I’m talking about I suggest you search about it because it’s the only way to truly understand how a framework works.

However if you are like me, then this is your first time ever (period) working with a framework. This means the concepts of how the Yii framework works (or any framework for that matter) is oblivious to you. Sure everyone who can code can read code, and sure we can all dive into the framework; read about the documentation, all the functions and classes and the whole framework inside out (which I did) – but understanding how to build on it, well that just takes practice and experience.

Ok so practice then right? Practice builds experience, seems like a simple solution. Well that’s easier said than done, because in order to practice anything right, you have to be taught first (either by self learning or someone showing you). Well not to discredit any of the supporters of the community but there really isn’t any well documented “self learning” or “someone teaching you” articles that show you where to start and how in Yii, or many other frameworks for that matter. I’m talking about actually building your application in mind set and then showing you where to plug in your logic.

Don’t get me wrong, the Yii documentation is well-established, with lots of reference to what classes are used, inherited and how they are used, everything. Yii is actually very well documented for anyone who knows how to use a framework and OOP, picking up the works of Yii is easy to them. But I wanted to learn where to actually start building my application. I have a site that I want to implement with the Yii framework but I could never figure out where to start.

This was a fork in my road to learning Yii, I wanted to do more than I could at this time. Reading documentation is great, it teaches you a lot about what you’re using, but no one really wants to sit here and read a novel – let’s face it we all want to get our hands dirty and start something now, we’re impatient. That’s the reason why we use frameworks, to make coding faster, to get the results in a more reliable, reusable and quicker fashion.

So this little guide is here to show you where to start. In my efforts to find a way to start coding with a framework, I came across a site, well a blog that the author was talking right down my alley. His article basically said, you’re new to frameworks, everywhere you go tries to talk about which framework to use or why and how frameworks work but no one really tells you how to build on them. I was like YES! That’s what I’m talking about. So he listed some simple solutions. His answer and when you hear it you’ll be smacking your head on the wall, was to think small. Build simple (so we think) applications that as a coder you can do on your own from scratch, maybe even in multiple languages. But building it within the framework – that’s how you learn to use the framework.