I have a function that removes many types of cross-site scripting
attacks from a text field.  Currently the function resides on a
component.  Then in my controller I make a call to this function before
I perform a Model->save.  I am thinking that the MVC proper place for
this to be done is really in the beforeValidates or beforeSave callback
function in the model.  But how do I include this function in several
models without adding the function to each one (recall DRY)?

The behaviors mechanism is not well documents but from what I can tell
may be too complex for something as simple as this.  The only other
option I can think of is to include the file directly in each model
(similar to how sanitize.php is used) but this seams to be outside the
CakePHP norm.

What is the proper way to include helper functions in a model?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to