T
T
thorii2016-08-29 20:56:36
PHP
thorii, 2016-08-29 20:56:36

What is the best way to implement multilanguage in View?

I use a template engine for views, the most banal one with <?=$var?> inserts. And the question is, how to display the translation for the static texts of the template? It is possible to declare a bunch of variables of the form <?=$sendButton;?> It is not difficult for me to do this thanks to the multiAssign template engine function, but it seems to me that this is far from comme il faut

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2016-08-29
@thorii

1. <?=$lang['sendButton'];?>where lang is an array/object with the required localization.
2. use helpers, as Alexander Litvinenko
wrote, the choice is yours.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question