Yii Framework Forum: View Php - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

View Php БД Rate Topic: -----

#1 User is offline   protein 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 09-March 13

Posted 09 March 2013 - 09:59 AM

Здравствуйте я новичок поэтому не судите строго
есть файл localhost\САЙТ\protected\views\****\view.php
там есть код

<?php
$this->widget('bootstrap.widgets.TbDetailView', array(
	'data'=>$model,
	'type'=>array('bordered', 'condensed','striped'),
	'attributes'=>array(
		'idBenefit',
		'BenefitName',
		'BenefitKey',
		'BenefitGroupID',
		'Visible',
	),
)); ?>

в "Visible" = 1 или 0
можно ли както вместо 1 и 0 вывести "да нет"

Attached File(s)


0

#2 User is offline   Boris_YII 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 18-February 13

Posted 09 March 2013 - 11:32 AM

Здравствуйте измените свой код так
<?php
$this->widget('bootstrap.widgets.TbDetailView', array(
        'data'=>$model,
        'type'=>array('bordered', 'condensed','striped'),
        'attributes'=>array(
                'idBenefit',
                'BenefitName',
                'BenefitKey',
                'BenefitGroupID',
                array("name" => "Visible", "value" => "($data->Visible == 1)?'Yes':'No'"),
        ),
)); ?>

1

#3 User is offline   protein 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 09-March 13

Posted 09 March 2013 - 11:58 AM

View PostBoris_YII, on 09 March 2013 - 11:32 AM, said:

Здравствуйте измените свой код так

Большое вам спасибо!! :lol:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users