custom validation does not allow validating individual elements

i’ve been learning Yii and have been excited to make use of its apparent wide range of functionality for doing nearly anything imaginable. however after much struggling i feel as though i’ve discovered a flaw that prevents me from doing what i need to do the “right” way.

basically i have a form that can receive one or more url’s. the user can paste as many urls as they want. i’m using enableAjaxValidation for each field and the validation of each field needs to happen separately. the validation process takes at least a few seconds so i do not want this to be done on every field. using yii’s built in functionality there is no way to do this. in my controller i can test for ajax. however to validate the data properly (through the model and custom validation function i have defined) i am required to use ActiveForm::validateMultiple which will proceed to validate all the urls instead of only the one that was modified.

with a work-around i can determine which exact url field was modified. however the problem now is that if i call ActiveForm::validate on a single model it does not return the correct JSON data for the errors to be displayed since the view has an array of url fields but the validator has a single field.

here is the problem. obviously i can circumvent yii completely in order to achieve my needs but the whole point of using yii is that this shouldn’t be necessary.

can anyone speak to this?

i’ve successfully hacked a solution by changing the array key names of the validation array returned by ActiveForm::validate. still seems like a bunk way of doing this.