Using the zend partialloop helper
I am using Zend Framework / Framework library
At some point I need to pass an array of texts (with a givenKey object) to the partialloop helper.
Now, in the partialLoop view, I would like to use Zend Translate.
Now I understand that Zend Translate is not an available true objectKey, but is there a way to use Zend Translate here and even use a helper ...?
Thanks in advance, math
0
a source to share
3 answers
You can try this .. This way, the "$ translate" object is available in all views and therefore viewable.
Bootsrap.php
protected function _initTranslate()
{
$translate = new Zend_Translate(array(
'adapter' => 'gettext',
'content' => APPLICATION_PATH . '/locale/en-US.mo',
'locale' => 'en'
));
Zend_Registry::set('translate', $translate);
Zend_Form::setDefaultTranslator($translate);
$this->bootstrap('view');
$view = $this->getResource('view');
$view->translate = $translate;
}
Hope it helps!
0
a source to share