Wiki

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

Managing constants easily

Created 3 years ago by briiC.lvTips4 comments – viewed 11,597 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 about a year ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 6,535 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 Kostas Apazidis (KonApaz)How-tos0 comments – viewed 6,896 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 8 months ago by le_topTips0 comments – viewed 4,450 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 4,415 times – ( +3 )
Sometimes writing views like

Insert a model record using CGridview

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

Sort and save order of model-elements drag & drop

Created 10 months ago by Kostas Apazidis (KonApaz)Tutorials2 comments – viewed 3,981 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 4,608 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.

Active Record snapshotting (Model data base history)

Created 28 days ago by BizleyTutorials3 comments – viewed 1,868 times – ( +1 ) – 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.

Generate CTreeview from database table and update a model

Created 10 months ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 2,820 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)