I'm not sure if that would even make sense, but...

I'm implementing a file behavior or rather refactoring one to make it
more reusable. One thing I do in my Model that actsAs File is
validation of the file; checking for the allowable file-extensions &
mime-type. These things really ought to go into the file behavior. But
there is no beforeValidation callback in behaviors. Sure I can check
for that stuff in beforeSave and abort the Save if necessary. But
doing it in the validation cycle should be the proper way.

Sure I can add a call to a method in my File behavior class from the
beforeValidate callback in my model. But that increases the coupling
there. Ideally I just want to set ActsAs with appropriate parameters
and get any Model to handle Fileuploads.

So is a beforeValidate callback planned for behaviors? If not, then
I'd be curious why it wouldn't fit the cakephp way.

Thanks for feedback.

:jcs


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to