[Solar-talk] Filter stack - Solar does not search Vendor_Filter
or Vendor_Model_ for filters
Antti Holvikari
anttih at gmail.com
Wed Dec 5 01:58:36 CST 2007
On Dec 4, 2007 11:39 PM, Raymond Kolbe <rkolbe at gmail.com> wrote:
> Hello all,
>
> I have created a filter called sanitizeMD5 which takes a value (string) and
> an optional salt (string) and returns the appropriate MD5 hash. I have added
> $this->_addFilter('password', 'sanitizeMD5'); to my Vendor_Model_Users model
> but Solar throws an exception (Solar_Class_Stack_Exception_ClassNotFound)
> stating it can not find the class sanitizeMD5. It appears that Solar is only
> searching Solar_Filter_ and Solar_Sql_Model_Filter_ directories for filters.
>
> Seeing how this is my first attempt with Solar_Stack I am asking for your
> help. How can I make Solar search (at the very least)
> Vendor_Model_User_Filter and/or Vendor_Filter directories?
>
> Also, I vote that (if it isn't already) this be added into Solar base code
> for ease of use.
>
> Any advice, comments, and/or suggestions are welcome.
If you want to put two custom dirs to the search stack, things get
little tricky. I suggest that you put your filter (md5) under
Vendor_Filter. Then Add a class Vendor_Model_Filter and have that
extend Vendor_Filter (create this class too). In Vendor_Model (or in
the model you are using) write this:
protected $_filter_class = 'Vendor_Model_Filter';
I think that should do it :-)
--
Antti Holvikari
More information about the Solar-talk
mailing list