Cstarrating Inside A Detailview

I am having some trouble to add stars rating inside a detailview . what i want to do is replace a number whit a stars imgs.

this was my attempt, but the error is "Fatal error: Cannot use object of type CStarRating as array";




<?php $this->widget('bootstrap.widgets.TbDetailView',array(

	'data'=>$model,

	'attributes'=>array(

		'IdContacto',

		$this->widget('CStarRating',array(

                    'name'=>'probabilidadRating',

                    'maxRating'=>5,

                    'minRating'=>1,

                    'value'=>$model->Probabilidad,

                    'readOnly'=>true,

                )),

		'Cuit',

		'Email',

		

	),

)); ?>



thks!

Hi,

Please see it

I hope it’s some help.

As the error says, the configuration should be an array with name, value.

Also the value has to be a string, not an object, so you have to set the third parameter of widget function to true in order to have the html returned.

In a word:


<?php $this->widget('bootstrap.widgets.TbDetailView',array(

        'data'=>$model,

        'attributes'=>array(

                'IdContacto',

                 array(

                     'name'=>'Probabilidad',

                     'value'=>$this->widget('CStarRating',

                         array(

                             'name'=>'probabilidadRating',

                             'maxRating'=>5,

                             'minRating'=>1,

                             'value'=>$model->Probabilidad,

                             'readOnly'=>true,

                         ),

                         true

                     ),


                 ),

                'Cuit',

                'Email',

                

        ),

)); ?>

Amazing man, that last parameter solve my problem. any widget have this last param?