Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

I18N Automatic Locale Formats With Gridview Setting Column Type

$
0
0
Hi,

I was wondering if I set language and sourceLanguage on application configuration the formats will be applied automatically. Showing the codes bellow I can explain better.

config.php
...
array(
	'name'=>'MyApplication',
	'basePath'=>'frontend',
	'sourceLanguage'=>'en',
	'language'=>'pt_br',
...


someGridView.php
...
$this->widget('zii.widgets.CGridView',array(
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		//'id',
		//'user_id',
		//'status',
		array(
			'class'=>'CCheckBoxColumn',
			'selectableRows'=>2,
			'name'=>'ids[]',
			'value'=>'$data->id',
		),			
		array(
			'name'=>'create_time',
			'type'=>'datetime',
			'value'=>'strtotime($data->create_time)',
			'htmlOptions'=>array('width'=>120),
		),
...


So I was expecting that if define the language param on application config the column type datetime will be automatically converted to locale format.

Am I wrong?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>