Concatenate in CGridView if !empty

My code:

<?php $this->widget(‘zii.widgets.CDetailView’, array(

'data'=&gt;&#036;model,


'attributes'=&gt;array(


	'id',


	'ytd_committed_amount',


	'ytd_actuals_amount',


	'forecast_amount',


	array(


			'label'=&gt;'Project Authority', 


			'value'=&gt;(&#33;empty(&#036;model-&gt;person-&gt;first_name.' '.&#036;model-&gt;person-&gt;last_name)),


			? CHtml::encode(&#036;model-&gt;person-&gt;first_name.&quot; &quot;.&#036;model-&gt;person-&gt;last_name) : ''),

getting an error. This works fine:

	array(


			'label'=&gt;'Type', 


			'value'=&gt;(&#33;empty(&#036;model-&gt;projectType-&gt;name_en))


			? CHtml::encode(&#036;model-&gt;projectType-&gt;name_en) : ''),

But the …first_name.’ '.$model->p… is causing an error.

Am i missing quotes, double quotes, or something else????

Just write a function in your model class.




public function getFullName()

{

    return $this->firstName . ' ' . $this->lastName;

}



Call it in the view as $model->fullName.

yes tried that. still getting an error, maybe because it’s late, i am not seeing it.

here is the complete code:

<?php $this->widget(‘zii.widgets.CDetailView’, array(

'data'=&gt;&#036;model,


'attributes'=&gt;array(


	'id',


	'tenant_id',


	'note_text',


	'created_date',


	'project_id',


	array(


			'label'=&gt;'Priority?', 


			'value'=&gt;&#036;model-&gt;is_priority ? &quot;Yes&quot; : &quot;No&quot;),


	array(


			'label'=&gt;'Created By', 


			'value'=&gt;(&#33;empty(&#036;model-&gt;person-&gt;fullName)


			? CHtml::encode(&#036;model-&gt;person-&gt;fullName) : ''),


),

)); ?>

error shoes as: syntax error eof . unexpected at )); ?>

nevermind. missing a parenthesis.

<?php $this->widget(‘zii.widgets.CDetailView’, array(

‘data’=>$model,

‘attributes’=>array(

‘id’,

‘tenant_id’,

‘note_text’,

‘created_date’,

‘project_id’,

array(

‘label’=>‘Priority?’,

‘value’=>$model->is_priority ? “Yes” : “No”),

array(

‘label’=>‘Created By’,

‘value’=>(!empty($model->person->fullName)) <------------------------------------

? CHtml::encode($model->person->fullName) : ‘’),

),

)); ?>