Whatever happened to.....

Some of the validation functionality from PRADO?

  • Client-side validation? Yii makes round trips to the server to correct validation errors Prado used to catch client side, saving a post back.
  • Data type validator? I tried to validate a boolean field and couldn't find one to do it. I don't want to assume that the input from my checkbox will always be a boolean. I think I remember something about an old rule about trust....? ;)
  • Validation groups? Is this largely redundant now thanks to the multiple form model?

Will this stuff be coming back at some point?

Client-side validation: no, we won't provide it anymore. This could be done using AJAX. And since Yii pages are also much faster, a whole page post back should still be tolerable. Most importantly, it is difficult to maintain consistency between server and client-side validation.

Data type validator: will add it. Could you create a ticket for this?

Validation groups: it is not needed any more.

hi qiang

thanks heaps for the quick reply! do i need to post 5 times to create a ticket?

client-side validation was one of the things i really really liked about prado. it's a shame to see it go, but i can understand the motivation to cut as much bloat as possible.

with validation groups, is it no longer needed because of the multiple form support?

As long as you have a gmail account, you can create a ticket at: http://code.google.c…yii/issues/list

Indeed, client-side validation was one of the original reasons that inspired me to write Prado. Actually, I should say we may or may not provide it in Yii. But definitely it is not in the top priorities.

Yes, validation group is not needed because we can use multiple forms. Form is the way to partition inputs in Yii.

Thanks again for the speed of the reply! I had been missing that trademark qiang turbo-response on the prado forums :)

I can understand that client-side validation would not be at the top of the priority list at this stage. I hope to see it again some day, but I'd rather see Yii reach v1 first. I'm certainly enjoying playing around with it.

As an aside, I've kept a memory_get_peak_usage() statement at the bottom of my entry script as I've been playing and Yii consistently has a memory footprint of no more than 1.2 to 1.8 mb, compared to PRADO which was regularly above the 10 mb mark. Good work!!

Thanks for your support!

Yes, Yii should be much lighter than Prado because Prado needs to reconstruct the big viewstate tree and control tree for each request.

TTextBox::SafeText?

I know PRADO used a 3rd party library for this, and I would assume you want to keep Yii's footprint to an absolute minimum, but I can't help but feel that this is a pretty important security feature. Is there any chance it will make a return in Yii, or will it need to be implemented as an extension somehow?

Yeah, such kind of security measures will be definitely added to the framework. I haven't decided in which form they should be added. They could be controller filters, helpers, or something else. I'd like to see some use cases first.