Wiki articles tagged with "model"

Showing 1-20 of 28 items.

Working with relational removals by yii2

Created 2 years ago by AndroideLP, updated a year ago by Jairus Martin.

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

0 0
2 followers
Viewed: 18 883 times
Version: 2.0
Category: Tutorials

Optimize Scenarios for yii2

Created 2 years ago by AndroideLP, updated a year 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.

3 0
2 followers
Viewed: 21 241 times
Version: 2.0
Category: Tutorials

A universal model attribute for its synthetic representation

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

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

Created 2 years ago by Wade Shuler, updated 2 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: 11 464 times
Version: 2.0
Category: How-tos

Active Record snapshotting (Model data base history)

Created 4 years ago by Bizley, updated 4 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: 10 492 times
Version: 1.1
Category: Tutorials

Add model validator in Controller

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

Create Form With DynamicModel

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

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

2 0
7 followers
Viewed: 29 859 times
Version: 2.0
Category: Tips
Tags: form, model, yii2

Expert's model generation with Gii

Created 4 years ago by le_top, updated 4 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: 11 694 times
Version: 1.1
Category: Tips

Sort and save order of model-elements drag & drop

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

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

1 0
4 followers
Viewed: 11 525 times
Version: 1.1
Category: Tutorials

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

Created 4 years ago by Kartik V, updated 4 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: 18 903 times
Version: 2.0
Category: Tips

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

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

Insert a model record using CGridview

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

CGridview displays existent rows of the table (using DataProvider)

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

Generate CTreeview from database table and update a model

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

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

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

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

0 2
40 followers
Viewed: 12 046 times
Version: 2.0
Category: Tutorials

Update CGridview row separately using ajax request

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

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

5 0
8 followers
Viewed: 19 686 times
Version: 1.1
Category: How-tos

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

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

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

2 0
6 followers
Viewed: 35 203 times
Version: 1.1
Category: How-tos

ClientValidation for files (modern browsers)

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

How to preload dropdowns in CForm

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

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

Created 5 years ago by Kostas Apazidis (KonApaz), updated 2 years ago by brianvu.

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

2 2
7 followers
Viewed: 27 028 times
Version: 1.1
Category: How-tos

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

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

Everyone have seen a multilayer menu in several CMS

6 0
8 followers
Viewed: 20 591 times
Version: 1.1
Category: How-tos