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...Archives For yii
Over the weekend, I posted an update to “The Yii Book”. This is version 0.5, which means I’m halfway there (about the time I was hoping to have the book done; so much for good intentions). With that in mind, my sincerest thanks to everyone for their patience. I know this is taking longer than we’d all like, but I’m doing my best and very much appreciate the understanding on your part. It’ll get done, I promise. And trust that “The Yii Book” is not taking a back seat to anything as far as my work goes these days.
Continue Reading...A topic critical to controllers, although not dictated within the actual controller code are routes. Routes are how URLs map to the controller and action to be invoked. Chapter 3, “A Manual for Your Yii Site,” introduced the basic concept and Chapter 4 explained how to configure the “urlManager” component to change how routes are formatted. Let’s now look at the topic in greater detail.
NOTE: This is an excerpt from Chapter 7, “Working with Controllers,” of “The Yii Book”.
Continue Reading...When I compose a newsletter, I look at my well of possible materials–questions, links, blog posts, etc., and try to come up with a theme, if at all possible. When looking at these this time around, the ones that seemed most worth sharing immediately all focus on, well, me. For example, there’s the presentation I gave to Boston PHP: you can view the slides and the raw video of it. Or there are some articles that I’ve published online that you might like. And there’s the status on “The Yii Book”.
So this newsletter is far more me-centric than most, but hopefully it’ll be of use to you still. Because, presumably, you subscribed to this newsletter in the first place because you were interested in what I’m doing, thinking, interested in, and so forth.
Also, if you do have something you’d like me to write about, address, or answer in future newsletters, now is a good time to send that in, as my well of topics is getting shallow. I think my next newsletter is going to be on goals, if you have any thoughts or questions along those lines (e.g., technologies to learn, ways to learn, etc.). I’ve also got an upcoming newsletter planned on public speaking.
And, as always, thanks for your interest in what I have to say and do!
Continue Reading...I haven’t written much about my book on the Yii framework on this blog in a while, so it’s high time for an update. As you may know, as of October 30, 2012, I began selling a self-published book titled, simply enough, “The Yii Book”. I’m selling the book in electronic formats—ePub, mobi, and PDF—to begin, and I’m selling it as I write it. I’ve been wanting to write a book about this excellent framework for some time, and thought such a book would be a good candidate for self-publishing, which I feel is an interesting little experiment.
Continue Reading...