View helper 内から他の View helper を呼び出す方法

メモ。
View helper の中から他の View helper を呼べないのと zf-users.jp の IRCid:wozozo さんに聞かれたのでやりかたを調べてみた。


結論:こんな感じで呼び出せる。

<?php
class Gene_View_Helper_Test extends Zend_View_Helper_Abstract
{      
    public function test()
    {  
        return $this->view->formText('hoge');
    }  
}

テンプレートはこんな感じで書くと・・・

<?php echo $this->Test() ?>

こんな感じになる。

<input type="text" name="hoge" id="hoge" value="">