2009年7月22日星期三

Re: [fw-mvc] Add custom View Helpers

Thanks, but the problem is not that I can't use the custom view helpers, it's
that I get all the warnings about the Zend view helpers apparently not
loading such as

Warning: Zend_Loader_PluginLoader::include_once(View/Helper/Doctype.php)
[function.Zend-Loader-PluginLoader-include-once]: failed to open stream: No
such file or directory in C:\home\system\www\Patrick Lock
Limited\Workspace\Patrick Lock Limited\library\Zend\Loader\PluginLoader.php
on line 372

Although everything is loading fine on the page. I just want to know why I
get these warnings?

thanks
Paddy

sayusi wrote:
>
> 2009/7/22 Paddy Lock <patrick.lock@gmail.com>:
>>
>> Hi,
>> I am trying to implement custom view helpers but nothing seems to work.
>>
>> This is what I have in my bootstrap class
>>
>> protected function _initViewDoctype()
>>    {
>>            $this->bootstrap('view');
>>            $view = $this->getResource('view');
>>            $view->addHelperPath('View/Helper', 'View_Helper'); //Change
>> as
>> per your path and class
>>            $view->setEncoding('UTF-8');
>>            $view->doctype('XHTML1_STRICT');
>>
>>    }
>>
>> my helper class is called View_Helper_StripSpecialChar and sits in
>> application/lib/View/Helper
>>
>> In my controller I can call the view helper function like this
>>
>> $test = $this->view->stripSpecialChar("test's");
>
> Maybe, you should try it with absolute path.
>
> András
>
> --
> - -
> -- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
> -- "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell
>
>

--
View this message in context: http://www.nabble.com/Trouble-adding-custom-View-Helpers-tp24603245p24603821.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: