Wiki

Articles tagged with "model"X
Displaying 11-20 of 28 result(s).

Save or Update Multiple related model values in one Tabular input form

Created 3 years ago by Kostas Apazidis (KonApaz)Tutorials4 comments – viewed 21,211 times – ( +1 / -8 ) – version 1.1
In this wiki I will show you how to save/update a model with many related model For example: How to set a product to multiple categories only in one post form ?

Insert a model record using CGridview

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

Generate CTreeview from database table and update a model

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 6,758 times – ( +1 / -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)

How to store array/widget configuration to the database with config validation rules

Created 3 years ago by Kartik VTutorials0 comments – viewed 7,416 times – ( +39 / -5 ) – version 2.0
You may have scenarios, where you want to store a specific array configuration to the database. A classic example could be saving Yii widget configuration to the database and then retrieving it at runtime, with dynamic parameters set. This wiki discusses one of the approaches to do this. Let's consider you have something like the NavBar configuration below to store in the db:

Update CGridview row separately using ajax request

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos10 comments – viewed 15,975 times – ( +8 / -1 ) – version 1.1
There are cases you want to update a record on CGridview directly

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

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos5 comments – viewed 31,532 times – ( +5 / -1 ) – version 1.1
Suppose you have an Application in Yii that manages hotels each one has many customers.

ClientValidation for files (modern browsers)

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos0 comments – viewed 10,187 times – ( +4 / -1 ) – 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 ?

How to preload dropdowns in CForm

Created 4 years ago by transistorTips0 comments – viewed 6,688 times – ( +1 / -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)

Created 4 years ago by Kostas Apazidis (KonApaz)How-tos4 comments – viewed 21,919 times – ( +4 / -7 ) – version 1.1
Ok, it is a little bit difficult to full understanding the unsafe validator.

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

Created 4 years ago by Kostas Apazidis (KonApaz)How-tos8 comments – viewed 17,564 times – ( +10 / -1 ) – version 1.1
Everyone have seen a multilayer menu in several CMS