Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Custom Validator Rule For 2 Attributes

$
0
0
Hi,
I have a Model Foo, with 2 attributes "bar" and "baz":
Foo->bar,
Foo->baz

"bar" and "baz" are related (they depend on eachother)
and need to be validated together

When Foo is validated (Foo->validate()) i want to be able to check dependencies between the "bar" and the "baz"

What is the best way to do that?

Is there a way that instead of passing the rules only comma separated ("bar, baz, asd"),
I could pass it a relation? ("bar + baz, asd")?

Could not find it in the docs...
Hope the question is clear

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>