Wiki articles in category Tips tagged with "model"

Showing 1-5 of 5 items.

Add model validator in Controller

Created 11 years ago by Kostas Apazidis (KonApaz) Kostas Apazidis (KonApaz), updated 11 years ago by Kostas Apazidis (KonApaz) Kostas Apazidis (KonApaz).

There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

1 1
3 followers
Viewed: 35 007 times
Version: 1.1
Category: Tips

Expert's model generation with Gii

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top.

Efficient coding with Yii implies efficient use of the code generator. This article shares the personalised Gii templates that were built starting from the standard templates proposed by AweGen.

1 0
2 followers
Viewed: 19 484 times
Version: 1.1
Category: Tips

Update two models with one view

Created 14 years ago by sensorario sensorario, updated 13 years ago by SebK SebK.

Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).

9 3
13 followers
Viewed: 59 037 times
Version: 1.1
Category: Tips

Managing constants easily

Created 14 years ago by briiC.lv briiC.lv, updated 14 years ago by briiC.lv briiC.lv.

/*

    Get class constants by token.
    If you set constants with same prefix, like:
	MY_STATUS_1
	MY_STATUS_2
	MY_STATUS_3
4 0
7 followers
Viewed: 34 059 times
Version: 1.1
Category: Tips

Search method of a model for filters when using dates - unixtimestamp in database

Created 15 years ago by Mukke Mukke, updated 14 years ago by jwerner jwerner.

I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

10 0
11 followers
Viewed: 40 037 times
Version: 1.1
Category: Tips