Sergei Gorjunov
Sergei Gorjunov

Reputation: 1799

get non-translated label in Zend decorator

How can I get non-translated label in class Label extends \Zend_Form_Decorator_Label ? When I tried to get it like "$this->getLabel()" it is already translated in russian.

Upvotes: 1

Views: 128

Answers (1)

drew010
drew010

Reputation: 69967

Prior to calling $this->getLabel(), you can disable the translator flag on the element by calling $element->setDisableTranslator(true) which will disable translation of that element.

Then, when you call getLabel() it checks to see if the translator for that element is enabled; if enabled, the label is translated and then returned, otherwise it is returned without translation like you want.

Upvotes: 1

Related Questions