[Solar-talk] helper_path
Jeff Surgeson
solar at 3hex.com
Fri May 26 03:13:01 PDT 2006
> (Aside: if you have helpers that you want to use across all your
> apps, I'd suggest putting them in Vendor_View_Helper.)
Yes I think this is going to be the simplest, and works for me now.
> 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.
Works for me.
> > 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
>
> 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';
Does not seem to work for me , adding that to my solar.config.php file seems
to not effect the class stack array at all.
Question! is _Name the App name or the helper file name? eg:
$config['Vendor_App_AppClassName']['helper_class'] = 'Vendor_View_Helper';
$config['Vendor_App_HelperClassName']['helper_class'] = 'Vendor_View_Helper';
Also is that 'Vendor_View_Helper' or 'Vendor_App_Helper' or
'Vendor/View/Helper' 'Vendor/App/Helper'
Either way it should still add something to the stack array which it appears
not to.
Fatal error: Uncaught exception 'Solar_Exception' class::code
'Solar_Class_Stack::ERR_CLASS_NOT_FOUND' with message 'ERR_CLASS_NOT_FOUND'
information array ( 'name' => 'Meta', 'stack' => array ( 0 =>
'Bulldog_App_Thebooknook_Helper_', 1 => 'Meta_', 2 =>
'Solar_View_Helper_', ), ) Stack trace:
#0 /var/www/localhost/htdocs/_lib/Solar/Base.php(267):
Solar::factory('Solar_Exception', Array)
#1 /var/www/localhost/htdocs/_lib/Solar/Class/Stack.php(202):
Solar_Base->_exception('ERR_CLASS_NOT_F...', Array)
#2 /var/www/localhost/htdocs/_lib/Solar/View.php(325):
Solar_Class_Stack->load('Meta')
#3 /var/www/localhost/htdocs/_lib/Solar/View.php(305):
Solar_View->newHelper('Meta')
#4 /var/www/localhost/htdocs/_lib/Solar/View.php(238):
Solar_View->getHelper('Meta') #5 [internal function]:
Solar_View->__call('Meta', Array)
#6 /var/www/localhost/htdocs/_lib/Bulldog/App/Layouts/head.part.php(26):
Solar_View->Meta(Array)
#7 /var/www/localhost/htdocs/_lib/Bulldog/App/Layouts/threeCol.layout.php(19):
in in /var/www/localhost/htdocs/_lib/Solar.php on line 460
That stack array stays the same with or without a $config setting.
If I put the helper in Bulldog_App_Thebooknook_Helper it will find it as it is
a default path, but not Bulldog_App_Helper_ as I do not seem able to get
that added to the stack array.
> 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)
Not added!
> Solar_View_Helper_* (which Solar always uses as the final fallback)
>
--
Jeff Surgeson
More information about the solar-talk
mailing list