Join GitHub today
Error using HeadTitle viewer without Translator module #4626
It is correct in the layout.phtml the headTitle helper be set to null when not using translator component?
I don't know why disabling "translator" component in module.config.php my app stop working because $this->headTitle() does not exists anymore.
Fatal error: Method Zend\View\Helper\HeadTitle::__toString() must not throw an exception in C:\Projetos\php\php 5.4\module\Application\view\layout\layout.phtml on line 0
To reproduce the error is simple.
I think this is wrong if i understood correctly, because the manual says this helpers are built-in and shouldn't be necessary to import.
What exactly did you comment out?
If I comment out only the translator configuration -- i.e., https://github.com/zendframework/ZendSkeletonApplication/blob/master/module/Application/config/module.config.php#L64-L73 -- all works as intended. It's only when I remove the alias from "translator" to "MvcTranslator" (https://github.com/zendframework/ZendSkeletonApplication/blob/master/module/Application/config/module.config.php#L60-L62) that I observe the issue.
This makes sense, as even though you're not using translation, the helpers are still consuming the Translate view helper as a dependency -- which means the translator service needs to be present.
We may revisit this (again) for ZF3, but there's simply not an easy answer to the situation. Leave the alias present, and you'll be fine -- there will be no overhead, as the translator has no configuration, and thus effectively is disabled for the intent of the view helpers.
Hi, I did as suggested and then I got:
I installed the extension and the problem was solved.
Before commenting out the translator conf, ZF2 didnt used the php-intl extension.