/** * Constructor */ public function __construct(Context $context) { parent::__construct($context); if (function_exists('gettext') === false) { throw new \RuntimeException("Translator cannot be instantiated. Gettext is not installed."); } $this->setDomain(array('name' => 'messages', 'path' => 'locale', 'invalidate' => null)); }
/** * @param Translator $translator * * @return $this */ public function setTranslator($translator) { if (!$translator instanceof Translator) { $translator = Translator::objectify($translator, array($this)); } $this->translator = $translator; return $this; }
/** * Constructor * * @param Context $context */ public function __construct(Context $context) { parent::__construct($context); $this->data = array(); }