Wiki

Sorted by date (updated)X
Displaying 351-360 of 777 result(s).

Drop down list with enum values for column of type ENUM >+> incorporate into giix

Updated 2 years ago by nsandenHow-tos3 comments – viewed 33,476 times – ( +14 ) – version 1.1
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 drop down list, which has the enum values as options. The main code was contributed by zaccaria in the forum (see this post).

jQuery UI Datepicker

Updated 2 years ago by ShahcheragheanHow-tos11 comments – viewed 72,616 times – ( +13 ) – version 1.1
We all love the convenient gadget, namely jQuery UI Datepicker as an input element for date. Yii supports it as CJuiDatePicker. Let's see how to use it.

Adding a date range search for CGridView the easy way

Updated 2 years ago by mikewalenTips6 comments – viewed 28,294 times – ( +12 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.

Catching bounce messages (NDR) and piping them to a Yii command

Updated 2 years ago by bennounaTutorials0 comments – viewed 9,006 times – ( +2 ) – version 1.1
In order to avoid bounce messages and unsolicited registrations, most webapps send automatic activation emails upon user registration, and the account remain inactive as long as it is not activated. Better yet, you can periodically purge your data by removing accounts that have not yet been activated.

Real-time display of server push data using Server-Sent Events (SSE)

Updated 2 years ago by bennounaHow-tos16 comments – viewed 43,562 times – ( +12 ) – version 1.1
There are several methods and techniques that come handy in the case you need to call an external resource periodically or if you are waiting for a server push, but I present here an easy and straightforward one using HTML5's Server-Sent Events (SSE).

defaultScope

Updated 2 years ago by Gerhard LiebenbergHow-tos4 comments – viewed 20,266 times – ( +5 / -1 ) – version 1.1
This example includes a composite condition as well as an empty condition - as if you bypass or disable defaultScope without using resetScope().

Set a menu - reusable code

Updated 2 years ago by Kostas Apazidis (KonApaz)Tips0 comments – viewed 5,712 times – ( +2 )
As we know Using crud generator creates menu items in view files (for each view file have a varius menu items)

The MrFisk IRC Bot

Updated 2 years ago by rAWTAZOthers0 comments – viewed 22,654 times – ( +6 ) – version 1.1
MrFisk is a sleek little bot hanging out in the official #yii IRC channel on freenode, meant to serve Yii users with documentation lookups and other things. This document intends to provide a summary of what MrFisk can do for you and how to use his fin^H^Heatures.
tags: MrFisk, YiiBot, IRC, bot

Rendering Views and Updating them with Ajax

Updated 2 years ago by Manish GuptaTips4 comments – viewed 19,258 times – ( +2 )
I wanted to implement a widget that could refresh itself through Ajax without refreshing the whole page. CGridView and CListView are excellent examples of such widgets.

Reference: Model rules validation

Updated 2 years ago by RodrigoHow-tos7 comments – viewed 689,587 times – ( +126 ) – version 1.1
This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.