Wiki

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

Managing constants easily

Created 4 years ago by briiC.lvTips4 comments – viewed 14,485 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 2 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 8,799 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 3 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 9,263 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 years ago by le_topTips0 comments – viewed 7,167 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 3 years ago by FirebreakerTips0 comments – viewed 5,716 times – ( +3 )
Sometimes writing views like

Active Record snapshotting (Model data base history)

Created about a year ago by BizleyTutorials3 comments – viewed 5,112 times – ( +2 ) – version 1.1
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.

Insert a model record using CGridview

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 8,220 times – ( +2 ) – version 1.1
CGridview displays existent rows of the table (using DataProvider)

Sort and save order of model-elements drag & drop

Created 2 years ago by Kostas Apazidis (KonApaz)Tutorials2 comments – viewed 6,313 times – ( +2 ) – version 1.1
Suppose you have Products,Categories and each product belongs in many categories

How to preload dropdowns in CForm

Created 3 years ago by transistorTips0 comments – viewed 5,865 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 2 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 5,287 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)