This example uses a MySQL DB with a table named tree
with the fields id
, name
, and parent_id
. The parent_id
will be NULL
for root elements. The SQL is kept simple (no autoinc, no FK, etc).
This example uses a MySQL DB with a table named tree
with the fields id
, name
, and parent_id
. The parent_id
will be NULL
for root elements. The SQL is kept simple (no autoinc, no FK, etc).
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue').
We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a Radio Button List, which has the enum values as options.
This is a rewrite of c@cba in the wiki article of [enumDropdownList](http://www...
pagoda box is very useful tool for a programmer to test their php app online so its very useful one. For deploying code pagodabox use git command
This article discusses the installation/configuration of the YiiBash project (https://github.com/dsoprea/YiiBash).
I was looking around wiki and found that was no approach as the one I did so I guessed this is worth to write.
In this mini howto I would like to show how to add a required captcha field in the login form, after a defined number of unsuccessfull attempts. To do this, I will use the blog demo that you have in default Yii download package (path/to/yii/demos/blog).
I needed a csv export function for my cgridview and I wanted to export the entire result set of the sorted and filtered cgridview the user was viewing via ajax.
Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.
Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.
For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.
Here is my experiment inspired by my own question and others from the forum.
Yesterday I've written a module for myself. Just an experiment. When I was feeling satisfied, I've created a repository on github, and pushed my code. My module and yii are on github. So I'll show you a "new" way to start our yii projects.
This tutorial assumes some basic knowledge of Yii and a functional development environment.
There are scenarios when you work with DVCS (like [Mercurial]( http://mercurial.selenic.com/) or [Git]( http://git-scm.com/)) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very...
Previously there was described a way to build an application with front-end and back-end. I would like to continue this theme and suggest another way to organize directories using WebApplicationEnd behavior.
Here is a way to dynamically extend tabs based on clips.
Probably even more complex things could be done.
Validators extending from [CValidator] all have a property named [message|CValidator::message]. You can set this property in the corresponding validation rule to customize the error message. For example, the following validation rule uses an error message that is different from the default one:
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here: