Begin doorgestuurd bericht:

> Van: Bart McLeod <mcl...@spaceweb.nl>
> Onderwerp: Antw.: [fw-general] Successfully Created View Helper In 
> Application.ini / Unsuccessful in Bootstrap
> Datum: 18 januari 2013 20:32:32 CET
> Aan: i_banks <bigbank...@gmail.com>
> 
> Hi,
> 
> In the bootstrap, you omitted the second argument to addHelperPath(), the 
> prefix 'App_View_Helper_', which you do *do* specify in application.ini. 
> That's why application.ini works and your bootstrap doesn't.
> 
> -Bart
> 
> 
> 
> Op 18 jan. 2013, om 19:32 heeft i_banks <bigbank...@gmail.com> het volgende 
> geschreven:
> 
>> Hello Zend Community. I'm using ZF 1.12. I'm trying to find out what I'm
>> doing wrong in my Bootstrap file in creating a View Helper. I want the view
>> helper to be available throughout the site. So I created a folder in my
>> library:  /library/App/View/Helper//
>> 
>> The class method is a one that calls the appropriate helper based on the
>> argument passed to it. So all of the helpers are in the same location (the
>> path mentioned above). Now as I stated in the Subject line, my
>> application.ini file worked. It's just the Bootstrap that doesn't. Here's
>> what I used for both:
>> 
>> *application.ini*
>> 
>> resources.view[]=
>> resources.view.helperPath.App_View_Helper_ = APPLICATION_PATH
>> "/../library/App/View/Helper/"
>> 
>> *Bootstrap.php*
>> 
>> protected function _initView()
>> {
>>  //Initialize view
>>  $view = new Zend_View();
>>  //add custom view helper path
>>  $view->addHelperPath(APPLICATION_PATH . '/../library/App/View/Helper');
>>      
>>  //do more stuff if needed
>>      
>> //add it to the view renderer
>> $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
>>                                      'ViewRenderer');
>> $viewRenderer->setView($view);
>> //Return it, so that it can be stored by the bootstrap
>> return $view;
>> }
>> 
>> Any thoughts?
>> 
>> 
>> 
>> 
>> --
>> View this message in context: 
>> http://zend-framework-community.634137.n4.nabble.com/Successfully-Created-View-Helper-In-Application-ini-Unsuccessful-in-Bootstrap-tp4658785.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>> 
>> -- 
>> List: fw-general@lists.zend.com
>> Info: http://framework.zend.com/archives
>> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>> 
>> 
> 


--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to