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


Solution puts translation in Zend Framework and Zend Translations



+1


a source


The translate () view helper will still be available in the partial loop script view, since it claims that you have placed the Zend_Translate object in the registry using the "Zend_Translate" key

Hello,



Rob ...

+1


a source


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







All Articles