overloading createTemplate method on presenter for kdyby tranlator

5 years ago

alnux
Member | 106
+
0
-

Hi i want to use kdyby translator on latte templates and on his documentation says that i have to overload createTemplate()

protected function createTemplate($class = NULL)
{
    $template = parent::createTemplate($class);
    $template->registerHelperLoader(callback($this->translator->createTemplateHelpers(), 'loader'));

    return $template;
}

but it works on 2.0.* function and im using 2.2.1 . Could you tell how and where i have to do the modification.

5 years ago

Quinix
Member | 108
+
0
-

You don't have to do it, as the documentation says:

If you're not hacking the Latte\Engine creation in any way, it will work right away, because the extension will register it.

5 years ago

Filip Procházka
Moderator | 4693
+
0
-

You had to do it for 2.1 and lower, but in 2.2 it should be registered automatically.

5 years ago

alnux
Member | 106
+
0
-

thanks