Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
systems:yii2:internationalization_i18n [2018/02/23 12:15] smayr created |
systems:yii2:internationalization_i18n [2018/04/11 17:38] (current) smayr [Controllers] |
||
---|---|---|---|
Line 212: | Line 212: | ||
</ | </ | ||
+ | === Controllers === | ||
+ | In the controller, all string to be displayed need to include the '' | ||
+ | <code php> | ||
+ | // Basic Messages | ||
+ | echo Yii:: | ||
+ | |||
+ | // Messages can contain parameter placeholders which will be replaced | ||
+ | // with the actual parameter values when calling Yii::t(). For example, | ||
+ | // the following message translation request would replace | ||
+ | // the {alias} placeholder in the original message with the actual alias value. | ||
+ | echo Yii:: | ||
+ | |||
+ | // Positional placeholders | ||
+ | $price = 100; | ||
+ | $count = 2; | ||
+ | $subtotal = 200; | ||
+ | echo \Yii:: | ||
+ | echo \Yii:: | ||
+ | </ | ||
+ | |||
+ | See more formatting and placeholders: | ||
== Detecting Language Automatically == | == Detecting Language Automatically == | ||