Quantcast

Zend View Helper

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Zend View Helper

Andreas Kraftl
Hello,

what is the simplest way to get a working Zend_View_Helper?

I init a clean project with Zend Tool and add a layout with Zend Tool.

Then I add a class in application/views/helpers/Sujet.php

class Zend_View_Helper_Sujet extends Zend_View_Helper_Abstract
{

    public function sujet()
    {
        return "I am the sujet view helper";
    }
}

In my layout script I call $this->sujet() without success.

Error: Zend_Loader_PluginLoader_Exception: Plugin by name 'Sujet' was
not found in the registry; used paths: ...

My Bootstrap.php is empty?

What must I change that it is working? Is it possible only to change the
application.ini?

Thanks
Andreas
PS: I just searching for the really simplest way :-).
--
Kraftl EDV - Dienstleistungen
Linux, Linuxschulungen, Webprogrammierung
Autofabrikstraße 16/6
1230 Wien

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend View Helper

takeshin
$view->addHelperPath('/other/path/to/helpers', 'Your_View_Helper');

--
takeshin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Zend View Helper

Hector Virgen
Or if you're using Zend_Application you can add this line to your application.ini

resources.view.helperPath.Default_View_Helper = APPLICATION_PATH "/views/helpers"

The part "Default_View_Helper" is your helper classname prefix for all view helpers in that folder.

--
Hector


On Sun, May 23, 2010 at 12:51 PM, takeshin <[hidden email]> wrote:

$view->addHelperPath('/other/path/to/helpers', 'Your_View_Helper');

--
takeshin
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-View-Helper-tp2227972p2228047.html
Sent from the Zend Framework mailing list archive at Nabble.com.

--
Hector Virgen
Loading...