Archives For yii

Let’s look at a different way of rendering view files: using static pages. The difference between a static page and a standard page in the site is that the static page does not change based upon any input. In other words, a dynamic page might display information based upon a provided model instance, but a static page just displays some hard-coded HTML (in theory).

This is an excerpt from Chapter 7, “Working with Controllers,” of “The Yii Book”.

Continue Reading...

Content decorators are a less heralded but interesting feature of the Yii framework. Content decorators allow you to hijack the view rendering process and add some additional stuff around the view file being rendered. In this excerpt from Chapter 7, “Working with Controllers,” of “The Yii Book”, I’ll explain what content decorators are and how you use them. (This does assume you have some familiarity with Yii and how it renders the complete layout.)

Continue Reading...

I’m happy to announce that a new version has been posted today. This version includes Chapter 13, “Using Extensions,” and Chapter 14, “JavaScript and jQuery.” This concludes Part 2 of the book (better late than never, eh?).

Continue Reading...

Quick update on my progress on “The Yii Book”…

Continue Reading...

Much of the work done with models involves using the methods defined within the model classes. These methods, such as rules() and relations(), are created by the code generator Gii. You’ll also add your own methods to the code generated for you. But, thanks to inheritance, there are lots of methods common to Yii models that you’ll frequently use. In this post, I want to specifically look at methods used to handle model-related events. Before looking at the usage of these methods, let’s first look at event handling in Yii in general.

Continue Reading...