How to add custom view helpers to Zend Framework 2 (beta 4)
问题 NOTE: This is an old question and the answers here no longer works (since beta5). See this question on how to do it with ZF2 stable version. I have looked at this example from the manual. Note that this is version 2 of the Zend Framework. I create this helper: <?php namespace Mats\Helper; use Zend\View\Helper\AbstractHelper; class SpecialPurpose extends AbstractHelper { protected $count = 0; public function __invoke() { $this->count++; $output = sprintf("I have seen 'The Jerk' %d time(s).",