Wiki articles tagged with "model"

Showing 1-20 of 28 items.
Created 2 years ago by AndroideLP, updated a year ago by Jairus Martin.

Working with relational removals by yii2

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

0 0
2 followers
Viewed: 17 858 times
Version: 2.0
Category: Tutorials
Created 2 years ago by AndroideLP, updated 10 months ago by AndroideLP.

Optimize Scenarios for yii2

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: 20 104 times
Version: 2.0
Category: Tutorials
Created 2 years ago by Alexandre Rodichevski, updated 2 years ago by Alexandre Rodichevski.

A universal model attribute for its synthetic representation

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 025 times
Version: 2.0
Category: Tips
Created 2 years ago by Wade Shuler, updated 2 years ago by Wade Shuler.

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

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: 10 964 times
Version: 2.0
Category: How-tos
Created 3 years ago by Bizley, updated 3 years ago by Bizley.

Active Record snapshotting (Model data base history)

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

Add model validator in Controller

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 376 times
Version: 1.1
Category: Tips
Created 4 years ago by Misbahul D Munir, updated 4 years ago by Misbahul D Munir.

Create Form With DynamicModel

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

2 0
7 followers
Viewed: 28 869 times
Version: 2.0
Category: Tips
Tags: form, model, yii2
Created 4 years ago by le_top, updated 4 years ago by le_top.

Expert's model generation with Gii

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

Sort and save order of model-elements drag & drop

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

1 0
4 followers
Viewed: 11 280 times
Version: 1.1
Category: Tutorials
Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

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

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

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

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

Insert a model record using CGridview

CGridview displays existent rows of the table (using DataProvider)

2 0
1 follower
Viewed: 12 776 times
Version: 1.1
Category: How-tos
Created 4 years ago by Kostas Apazidis (KonApaz), updated 4 years ago by Kostas Apazidis (KonApaz).

Generate CTreeview from database table and update a model

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: 8 905 times
Version: 1.1
Category: How-tos
Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

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

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

0 2
40 followers
Viewed: 11 576 times
Version: 2.0
Category: Tutorials
Created 4 years ago by Kostas Apazidis (KonApaz), updated 4 years ago by Kostas Apazidis (KonApaz).

Update CGridview row separately using ajax request

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

5 0
8 followers
Viewed: 19 383 times
Version: 1.1
Category: How-tos
Created 5 years ago by Kostas Apazidis (KonApaz), updated 4 years ago by CeBe.

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

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

2 0
6 followers
Viewed: 34 918 times
Version: 1.1
Category: How-tos
Created 5 years ago by Kostas Apazidis (KonApaz), updated 4 years ago by CeBe.

ClientValidation for files (modern browsers)

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 622 times
Version: 1.1
Category: How-tos
Created 5 years ago by transistor, updated 5 years ago by transistor.

How to preload dropdowns in CForm

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 489 times
Version: Unknown (update)
Category: Tips
Created 5 years ago by Kostas Apazidis (KonApaz), updated 2 years ago by brianvu.

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

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

2 2
7 followers
Viewed: 26 637 times
Version: 1.1
Category: How-tos
Created 5 years ago by Kostas Apazidis (KonApaz), updated 4 years ago by Kostas Apazidis (KonApaz).

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

Everyone have seen a multilayer menu in several CMS

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