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

Add model validator in Controller

Updated 2 months ago by KonApazTips4 comments – viewed 2,030 times – ( +1 / -1 ) – version 1.1
There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

Create Form With DynamicModel

Updated 2 months ago by Misbahul D MunirTips2 comments – viewed 2,156 times – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

Expert's model generation with Gii

Updated 5 months ago by le_topTips0 comments – viewed 3,555 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.

Sort and save order of model-elements drag & drop

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

Model validation for field ranges using yii2-field-range extension

Updated 7 months ago by Kartik VTips0 comments – viewed 3,033 times – ( +29 ) – version 2.0
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.

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

Updated 7 months ago by KonApazTutorials4 comments – viewed 5,710 times – ( +1 / -6 ) – 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

Updated 7 months ago by KonApazHow-tos0 comments – viewed 3,544 times – ( +2 ) – version 1.1
CGridview displays existent rows of the table (using DataProvider)

Generate CTreeview from database table and update a model

Updated 7 months ago by KonApazHow-tos0 comments – viewed 2,198 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)

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

Updated 7 months ago by KonApazHow-tos8 comments – viewed 11,642 times – ( +10 ) – version 1.1
Everyone have seen a multilayer menu in several CMS

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

Updated 7 months ago by Kartik VTutorials0 comments – viewed 2,527 times – ( +29 / -4 ) – 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: