Reputation: 17495
I'd like to replace --
string with —
globally, everywhere within my Yii 1.x application (in every view, in strings generated by controllers or queried from database, everywhere).
What would be the best approach / solution to achieve this.
EDIT: I need to do this in the code, of course. It is not a question about, how to do this in the IDE, but using Yii.
Upvotes: 0
Views: 114
Reputation: 51
I believe you can use several ways. If you are not planning to set up i18n on your system you can handle it with Yii::t expression
$result = Yii::t('common', 'May is a {{ rainy }} month', [
'{{ rainy }}' => 'sunny',
]);
Otherwise, you can simply go with native PHP functions such as str_replace https://www.php.net/manual/es/function.str-replace.php and sprintf https://www.php.net/manual/es/function.sprintf.php
Upvotes: 1