How to add a view helper directory (zend framework)

后端 未结 5 1784
忘掉有多难
忘掉有多难 2020-12-03 16:59

I begin with ZF (1.9.7), and I want to use View Helpers from a library shared between all my projects. But I can\'t find how to add it directory to the helpers path. My herp

5条回答
  •  既然无缘
    2020-12-03 17:46

    EDIT: Check out view helper in zend framework for a more detailed take on this issue using rob allen's Loggedinas view helper.

    Not only can you do as specified by David Caunt, but you can also do it like this in your bootstrap. Note there is always more than one way to do anything in Zend Framework

    Check out http://devzone.zend.com/article/3412

    If you have access to the view object, do the following.

    addHelperPath('My/View/Helper/', 'My_View_Helper'); 
    ?>
    

    you may need to obtain the view object if you in a front controller plugin

    Also Check out this really great set of posts starting here:

    http://zend-framework-community.634137.n4.nabble.com/Getting-view-from-Bootstrap-ZF1-8-tp659447p659460.html

提交回复
热议问题