Wiki articles tagged with "model"

Showing 1-20 of 28 items.

Working with relational removals by yii2

Created 6 years ago by AndroideLP, updated 5 years ago by Jairus Martin.

This tutorial shows you how to safely remove records between relationships.

0 0
2 followers
Viewed: 33 074 times
Version: 2.0
Category: Tutorials

Optimize Scenarios for yii2

Created 6 years ago by AndroideLP, updated 3 years ago by AndroideLP.

Working with scenarios, with models that can receive many modifications in their rules or structures as development evolves, can create disruptions in the rescue process.

4 0
2 followers
Viewed: 38 836 times
Version: 2.0
Category: Tutorials

A universal model attribute for its synthetic representation

Created 6 years ago by Alexandre Rodichevski, updated 6 years ago by Alexandre Rodichevski.

It is convenient to use the same identification attribute, say info, in all of the active records of your application. It should be a virtual read-only attribute defined by a getter method, its label being the model name.

0 0
3 followers
Viewed: 13 406 times
Version: 2.0
Category: Tips

How To: Custom Client Validation On Checkbox Toggle and Optional Input Field

Created 6 years ago by Wade Shuler, updated 6 years ago by Wade Shuler.

I just chased my tail around for a bit today. I got lost with setting the status of all inputs, and banging my head on why the "validate" function just wasn't working.

0 0
1 follower
Viewed: 21 000 times
Version: 2.0
Category: How-tos

Active Record snapshotting (Model data base history)

Created 8 years ago by Bizley, updated 8 years ago by Bizley.

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.

1 0
5 followers
Viewed: 15 629 times
Version: 1.1
Category: Tutorials

Add model validator in Controller

Created 8 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

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

1 1
3 followers
Viewed: 28 468 times
Version: 1.1
Category: Tips

Create Form With DynamicModel

Created 8 years ago by Misbahul D Munir, updated 8 years ago by Misbahul D Munir.

In yii2 we can create form without create FormModel. Here we go

4 0
8 followers
Viewed: 44 662 times
Version: 2.0
Category: Tips
Tags: form, model, yii2

Expert's model generation with Gii

Created 8 years ago by le_top, updated 8 years ago by le_top.

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.

1 0
2 followers
Viewed: 16 079 times
Version: 1.1
Category: Tips

Sort and save order of model-elements drag & drop

Created 8 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

Suppose you have Products,Categories and each product belongs in many categories

1 0
4 followers
Viewed: 16 892 times
Version: 1.1
Category: Tutorials

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

Created 8 years ago by Kartik V, updated 8 years ago by Kartik V.

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.

0 0
37 followers
Viewed: 26 235 times
Version: 2.0
Category: Tips

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

Created 8 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

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 ?

1 0
1 follower
Viewed: 38 944 times
Version: 1.1
Category: Tutorials

Insert a model record using CGridview

Created 8 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

CGridview displays existent rows of the table (using DataProvider)

2 0
1 follower
Viewed: 16 670 times
Version: 1.1
Category: How-tos

Generate CTreeview from database table and update a model

Created 8 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)

1 0
1 follower
Viewed: 12 983 times
Version: 1.1
Category: How-tos

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

Created 8 years ago by Kartik V, updated 8 years ago by Kartik V.

Note the tag {{homeUrl}} will be dynamically replaced at runtime.

1 3
40 followers
Viewed: 21 155 times
Version: 2.0
Category: Tutorials

Update CGridview row separately using ajax request

Created 8 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

There are cases you want to update a record on CGridview directly

5 0
8 followers
Viewed: 24 164 times
Version: 1.1
Category: How-tos

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

Created 9 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by CeBe.

Suppose you have an Application in Yii that manages hotels each one has many customers.

2 0
6 followers
Viewed: 39 905 times
Version: 1.1
Category: How-tos

ClientValidation for files (modern browsers)

Created 9 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by CeBe.

There are cases that you want to validate the file format, size, extension etc but how to do that without submit the form ?

2 0
6 followers
Viewed: 17 102 times
Version: 1.1
Category: How-tos

How to preload dropdowns in CForm

Created 9 years ago by transistor, updated 9 years ago by transistor.

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.

1 0
2 followers
Viewed: 11 291 times
Version: Unknown (update)
Category: Tips

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

Created 9 years ago by Kostas Apazidis (KonApaz), updated 6 years ago by brianvu.

Ok, it is a little bit difficult to full understanding the unsafe validator.

2 2
7 followers
Viewed: 34 647 times
Version: 1.1
Category: How-tos

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

Created 9 years ago by Kostas Apazidis (KonApaz), updated 8 years ago by Kostas Apazidis (KonApaz).

Everyone have seen a multilayer menu in several CMS

7 0
8 followers
Viewed: 25 754 times
Version: 1.1
Category: How-tos