Wiki articles tagged with "model"

Showing 1-20 of 28 items.

Working with relational removals by yii2

Created 3 years ago by AndroideLP, updated 3 years ago by Jairus Martin.

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

0 0
2 followers
Viewed: 25 699 times
Version: 2.0
Category: Tutorials

Optimize Scenarios for yii2

Created 3 years ago by AndroideLP, updated 11 months 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: 28 977 times
Version: 2.0
Category: Tutorials

A universal model attribute for its synthetic representation

Created 4 years ago by Alexandre Rodichevski, updated 4 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: 9 873 times
Version: 2.0
Category: Tips

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

Created 4 years ago by Wade Shuler, updated 4 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: 15 404 times
Version: 2.0
Category: How-tos

Active Record snapshotting (Model data base history)

Created 5 years ago by Bizley, updated 5 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: 13 003 times
Version: 1.1
Category: Tutorials

Add model validator in Controller

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 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: 24 335 times
Version: 1.1
Category: Tips

Create Form With DynamicModel

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

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

3 0
8 followers
Viewed: 36 791 times
Version: 2.0
Category: Tips
Tags: form, model, yii2

Expert's model generation with Gii

Created 6 years ago by le_top, updated 6 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: 13 571 times
Version: 1.1
Category: Tips

Sort and save order of model-elements drag & drop

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

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

1 0
4 followers
Viewed: 13 453 times
Version: 1.1
Category: Tutorials

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

Created 6 years ago by Kartik V, updated 6 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: 21 804 times
Version: 2.0
Category: Tips

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

Created 6 years ago by Kostas Apazidis (KonApaz), updated 6 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: 34 859 times
Version: 1.1
Category: Tutorials

Insert a model record using CGridview

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

CGridview displays existent rows of the table (using DataProvider)

2 0
1 follower
Viewed: 14 469 times
Version: 1.1
Category: How-tos

Generate CTreeview from database table and update a model

Created 6 years ago by Kostas Apazidis (KonApaz), updated 6 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: 10 470 times
Version: 1.1
Category: How-tos

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

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

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

0 3
40 followers
Viewed: 15 668 times
Version: 2.0
Category: Tutorials

Update CGridview row separately using ajax request

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

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

5 0
8 followers
Viewed: 21 249 times
Version: 1.1
Category: How-tos

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

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

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

2 0
6 followers
Viewed: 36 991 times
Version: 1.1
Category: How-tos

ClientValidation for files (modern browsers)

Created 6 years ago by Kostas Apazidis (KonApaz), updated 6 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: 14 614 times
Version: 1.1
Category: How-tos

How to preload dropdowns in CForm

Created 7 years ago by transistor, updated 7 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: 9 635 times
Version: Unknown (update)
Category: Tips

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

Created 7 years ago by Kostas Apazidis (KonApaz), updated 4 years ago by brianvu.

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

2 2
7 followers
Viewed: 30 163 times
Version: 1.1
Category: How-tos

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

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

Everyone have seen a multilayer menu in several CMS

7 0
8 followers
Viewed: 22 619 times
Version: 1.1
Category: How-tos