Wiki

Articles tagged with "model validation"X
Displaying 1-6 of 6 result(s).

Optimize Scenarios for yii2

Created about a year ago by AndroideLPTutorials0 comments – viewed 9,774 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

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

Created 3 years ago by edoardo849How-tos2 comments – viewed 14,656 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

Created 6 years ago by Luke JurgsTutorials12 comments – viewed 134,174 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

Created 6 years ago by nickcvHow-tos14 comments – viewed 206,031 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?

Created 8 years ago by qiangTutorials33 comments – viewed 219,866 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: