Difference between #210 and #211 of
Yii v2 snippet guide

Revision #211 has been created by rackycz on Jul 8, 2020, 4:58:12 PM with the memo:

Formatter
« previous (#210) next (#212) »

Changes

Title unchanged

Yii v2 snippet guide

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2

Content changed

[...]
As you can see in the snippet above, other controllers must contain row "use app\controllers\BaseController" + "extends BaseController".

**Formatting values based on your Locale **
---
Go to config\web.php and add following values:

 
```php
$config = [
// ..
[...]
// ...
]

 
```
 
PS: I do not use currency formatter as it always puts the currency name before the number. For example USD 123. But in my country we use format: 123 CZK.

More links on this topic:
- [yii\i18n\Formatter](https://www.yiiframework.com/doc/api/2.0/yii-i18n-formatter)
- [Examples](https://yii2-framework.readthedocs.io/en/stable/guide/output-formatter)
- [More examples](https://stackoverflow.com/questions/27078178/yii2-number-format)
[...]
7 0
4 followers
Viewed: 255 174 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Sep 19, 2019
Last updated: 5 months ago
Update Article

Revisions

View all history