$this->view->headScript()->prependFile('/js/filename.js');
jjsanders wrote:
>
> ---------- Forwarded message ----------
> From: Jigal sanders <jigalroecha@gmail.com>
> Date: Tue, Aug 5, 2008 at 10:23 AM
> Subject: Re: [fw-mvc] modify header from controller
> To: Neil Garb <neil.garb@gmail.com>
>
>
> Gives me this error:
>
> *Fatal error*: Uncaught exception 'Zend_View_Exception' with message
> 'Method
> "prependFilename" does not exist' in
> /var/www/library/Zend/View/Helper/Placeholder/Container/Standalone.php:216
> Stack trace: #0 /var/www/library/Zend/View/Helper/HeadScript.php(256):
> Zend_View_Helper_Placeholder_Container_Standalone->__call('prependFilename',
> Array) #1 [internal function]:
> Zend_View_Helper_HeadScript->__call('prependFilename', Array) #2
> /var/www/application/admin/controllers/EvenementController.php(65):
> Zend_View_Helper_HeadScript->prependFilename('/js/filename.js') #3
> /var/www/library/Zend/Controller/Action.php(502):
> Admin_EvenementController->allAction() #4
> /var/www/library/Zend/Controller/Dispatcher/Standard.php(293):
> Zend_Controller_Action->dispatch('allAction') #5
> /var/www/library/Zend/Controller/Front.php(914):
> Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
> Object(Zend_Controller_Response_Http)) #6
> /var/www/public/Bootstrap.php(11):
> Zend_Controller_Front->dispatch() #7 /var/www/public/inde in *
> /var/www/library/Zend/View/Helper/Placeholder/Container/Standalone.php* on
> line *216
>
>
> *btw, where should I store my js files accourding to the zend mvc
> principle?
> *
> *
> On Tue, Aug 5, 2008 at 10:19 AM, Neil Garb <neil.garb@gmail.com> wrote:
>
>> Try
>>
>> $this->view->headScript()->prependFilename('/js/filename.js');
>>
>> and then in your view:
>>
>> <head>
>> ...
>> <?php echo $this->headScript() ?>
>> ...
>> </head>
>>
>> - Neil
>>
>> On Tue, Aug 5, 2008 at 10:17 AM, Jigal sanders <jigalroecha@gmail.com>
>> wrote:
>> > Hello everyone,
>> >
>> > If I want to use a javacript in a certain view. How should I Modify my
>> > header file to appoint to the right javascript?
>> >
>> > --
>> > Kind regards
>> >
>> > Jigal Sanders
>> >
>> >
>>
>
>
>
> --
> Met vriendelijke groet,
>
> Jigal Sanders
> A.J. Ernststraat 739
> 1082 LK Amsterdam
> Mobiel: 06-42111489
>
>
>
> --
> Met vriendelijke groet,
>
> Jigal Sanders
> A.J. Ernststraat 739
> 1082 LK Amsterdam
> Mobiel: 06-42111489
>
>
--
View this message in context: http://www.nabble.com/modify-header-from-controller-tp18826546p18876598.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论