[Solar-talk] helper_path

Paul M Jones pmjones at solarphp.com
Thu May 25 16:07:05 PDT 2006


On May 25, 2006, at 5:55 PM, Jeff Surgeson wrote:

> Have my own Meta helper which until now I have always just stuck in
> Solar_View_Helper, but would like to take advantage of new version  
> stuff.

(Aside: if you have helpers that you want to use across all your  
apps, I'd suggest putting them in Vendor_View_Helper.)

Ah, yes, this sounds familiar -- you should be able to call it  
Vendor_View_Helper_Meta now, and keep it in Vendor/View/Helper/Meta.php.


> By default Solar looks in Vendor_App_Class_Helper for the vendor  
> generated
> helper files, can I not set a config setting that tell Solar to  
> look in
> Vendor_App_Helper for any Vendor helper files and then  
> Solar_View_Helper for
> Solar helper files as apposed to Vendor_App_Class_Helper as I then  
> need to
> have a helper dir in each app which is fine except most helpers are  
> used by
> all of my apps.

Yes, you should be able to set the 'helper_class' config key to  
something like this (assuming a solar config file here) --

     $config['Vendor_App_Name']['helper_class'] = 'Vendor_View_Helper';

Then the helper classes should get searched in this order:

     Vendor_App_Name_Helper_* (this is auto-added by the page  
controller)
     Vendor_View_Helper_* (which was added from the config)
     Solar_View_Helper_* (which Solar always uses as the final fallback)

Does that help at all?



--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.   <http://solarphp.com>

Savant: The simple, elegant, and powerful solution for
templates in PHP.   <http://phpsavant.com>




More information about the solar-talk mailing list