Wiki

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

Optimize Scenarios for yii2

Updated about a year ago by AndroideLPTutorials0 comments – viewed 9,703 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.

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

Updated about a year ago by Wade ShulerHow-tos0 comments – viewed 6,599 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.

MongoDb's embedded documents mapping for ActiveRecord in Yii2

Updated 3 years ago by CeBeHow-tos2 comments – viewed 14,622 times – ( +6 / -1 ) – version 2.0
You are working with MongoDb and you have embedded documents in your collection that you want to easily map in your Model for CRUD operations.

Understanding Scenarios

Updated 4 years ago by Luke JurgsTutorials12 comments – viewed 134,040 times – ( +31 / -1 ) – version 1.1
Scenarios are an extremely useful tool for separating validation tasks on any class you use derived from CModel. In this tutorial we will use CActiveRecord.

Create your own Validation Rule

Updated 5 years ago by GismoHow-tos14 comments – viewed 205,880 times – ( +76 / -4 ) – version 1.1
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.

How to use a single form to collect data for two or more models?

Updated 5 years ago by Yang HeTutorials33 comments – viewed 219,780 times – ( +118 / -3 ) – version 1.1
Assume we want to use a single HTML form to collect input for both model A and model B, and we want to display input errors (if any) in the same error summary box. We can define the following action code: