Wiki

Articles tagged with "model", sorted by date (updated)X
Displaying 1-10 of 13 result(s).

ClientValidation for files (modern browsers)

Updated 9 days ago by CeBeHow-tos0 comments – viewed 3,000 times – ( +3 ) – version 1.1
There are cases that you want to validate the file format, size, extension etc but how to do that without submit the form ?

Take more control of CGridview and model searching (related model or another controller)

Updated 9 days ago by CeBeHow-tos5 comments – viewed 9,088 times – ( +5 ) – version 1.1
Suppose you have an Application in Yii that manages hotels each one has many customers.

Reference: Model rules validation

Updated 5 months ago by RodrigoHow-tos5 comments – viewed 432,411 times – ( +111 ) – 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.

How to preload dropdowns in CForm

Updated 9 months ago by transistorTips0 comments – viewed 3,121 times – ( +1 )
So you want to use CForm (form builder), but need to preload dropdowns in a form? It's simpler than it seems. You got your CFormModel, CForm and the actual Form, right? Let's say you have the typical State -> City dependent dropdowns, so you would want to load the from with the State and City selected.

"safe" and "unsafe" Model validators (massive assignments)

Updated 9 months ago by KonApazHow-tos4 comments – viewed 7,112 times – ( +4 / -2 )
Ok, it is a little bit difficult to full understanding the unsafe validator.

Generate a multi-lever array sub-category for a menu

Updated 9 months ago by KonApazHow-tos7 comments – viewed 7,663 times – ( +10 )
Everyone have seen a multilayer menu in several CMS

model rules depended by user roles-permissions

Updated 10 months ago by KonApazHow-tos0 comments – viewed 4,528 times – ( +3 )
This is a reference about model validators and user roles. In many cases we want model validators to applied only for some privileged users or not

Inline views, write less

Updated 10 months ago by FirebreakerTips0 comments – viewed 3,446 times – ( +3 )
Sometimes writing views like

Update two models with one view

Updated about a year ago by SebKTips10 comments – viewed 27,959 times – ( +10 / -2 ) – version 1.1
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).
tags: database, model, view, form

Managing constants easily

Updated 2 years ago by briiC.lvTips4 comments – viewed 9,101 times – ( +4 ) – version 1.1
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.