Wiki

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

Working with relational removals by yii2

Updated 6 months ago by Jairus MartinTutorials2 comments – viewed 9,832 times – ( +1 / -1 ) – version 2.0
This tutorial shows you how to safely remove records between relationships.

Optimize Scenarios for yii2

Updated about a year ago by AndroideLPTutorials0 comments – viewed 9,720 times – ( +1 / -1 ) – version 2.0
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.

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

Updated about a year ago by brianvuHow-tos4 comments – viewed 23,138 times – ( +4 / -7 ) – version 1.1
Ok, it is a little bit difficult to full understanding the unsafe validator.

A universal model attribute for its synthetic representation

Updated about a year ago by Alexandre RodichevskiTips2 comments – viewed 4,571 times – ( -1 ) – version 2.0
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.

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

Updated about a year ago by Wade ShulerHow-tos0 comments – viewed 6,600 times – ( -1 ) – version 2.0
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.

Active Record snapshotting (Model data base history)

Updated 2 years ago by BizleyTutorials3 comments – viewed 8,053 times – ( +2 / -1 ) – version 1.1
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.

Add model validator in Controller

Updated 3 years ago by Kostas Apazidis (KonApaz)Tips4 comments – viewed 17,951 times – ( +1 / -2 ) – 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 3 years ago by Misbahul D MunirTips4 comments – viewed 19,362 times – ( +2 / -1 ) – 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 3 years ago by le_topTips0 comments – viewed 9,391 times – ( +3 / -1 ) – 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 3 years ago by Kostas Apazidis (KonApaz)Tutorials2 comments – viewed 8,635 times – ( +2 / -1 ) – version 1.1
Suppose you have Products,Categories and each product belongs in many categories