Update - Delete - View I'm sure you've already seen and used the basic buttons in a CGridView and maybe even used the template phrases to modify the behaviours but sometimes we need to break out of this box and create custom buttons for...
Blog
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ex sem, facilisis sed viverra nec, sagittis vel quam nulla nisi mi scelerisque quis.
Yii – Further model validation
UPDATED 26-Jan-2012 ! A brief note today to add some more specific validation to your models. As we all know - "rubbish in == rubbish out", so let's get that data nice and clean, right up front! The address regex pattern is using a short-code \w...
Yii – Relations using a non-primary key
Often mistakes you make in your database design stage come around and bite you in the butt later! My Mistake I'm just testing a new reservation system that should be going live soon and it's looking really good, expected results are bang on, the system is nice and...
Date validation in Yii
Moving on from my last post on Yii validation rules for text fields, next I am going to be looking at validating dates and date ranges. The date validator CDateValidator was added to Yii in release 1.1.7 and provides an easy method to validate that a field contains a...
Yii – simple email and mail merge
I needed an email mechanism for a customer that was light and easy to configure. Yii extensions I tried several email extensions from the Yii website all of which I found overly complex to setup and use. I then remembered that I had used a simple class on a PHP...
Yii – How to customize a CGridView CbuttonColumn – part 2
Part 2 (see part 1 here) Always set the class to CButtonColumn. The 'template' option enables you to name your buttons as you wish. Yii understands the basic crud names of 'update', 'view' and 'delete' but you can specify custom names as you wish as I...
Yii – Separation of admin controllers from public controllers
There are a number of posts and Wiki's on this subject and I love all the discussions and frays that you get on the Yii Framework forum. One of the popular methods is to move your Admin functions into a module, but for me this can lead to confusion and duplication,...
Using Is NOT NULL in query builder
When building where clauses it's not that well documented how to use NOT and NULL . Starting with a simple query: If we wanted to select all posts where the content had something in it Note the doubles set of square brackets, first...
Subscribe