Wiki

Articles tagged with "model", sorted by ratingX
Displaying 11-20 of 21 result(s).

Managing constants easily

Created 2 years ago by briiC.lvTips4 comments – viewed 10,294 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.

ClientValidation for files (modern browsers)

Created 9 months ago by KonApazHow-tos0 comments – viewed 4,721 times – ( +4 ) – 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 ?

model rules depended by user roles-permissions

Created about a year ago by KonApazHow-tos0 comments – viewed 5,636 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

Expert's model generation with Gii

Created 2 months ago by le_topTips0 comments – viewed 2,482 times – ( +3 ) – version 1.1
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.

Inline views, write less

Created about a year ago by FirebreakerTips0 comments – viewed 3,898 times – ( +3 )
Sometimes writing views like

Insert a model record using CGridview

Created 4 months ago by KonApazHow-tos0 comments – viewed 2,214 times – ( +2 ) – version 1.1
CGridview displays existent rows of the table (using DataProvider)

Sort and save order of model-elements drag & drop

Created 3 months ago by KonApazTutorials2 comments – viewed 2,606 times – ( +2 ) – version 1.1
Suppose you have Products,Categories and each product belongs in many categories

How to preload dropdowns in CForm

Created about a year ago by transistorTips0 comments – viewed 3,825 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.

Generate CTreeview from database table and update a model

Created 4 months ago by KonApazHow-tos0 comments – viewed 1,553 times – ( +1 ) – version 1.1
Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)

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

Created about a year ago by KonApazHow-tos4 comments – viewed 9,689 times – ( +4 / -6 )
Ok, it is a little bit difficult to full understanding the unsafe validator.