Reputation: 1409
If I need to create a table similar to this:
And I have an array:
array (
'0'=>array('year1'=>'2010', 'year2'=>'2010', 'year3'=>'2010' )
'1'=>array('capacity1'=>'5', 'capacity2'=>'10', 'capacity3'=>'15' )
'2'=>array('size1'=>'large', 'size2'=>'small', 'size3'=>'medium' )
'3'=>array('cost1'=>'1', 'cost2'=>'2', 'cost3'=>'3' )
'4'=>array('average_capacity'=>'10', 'average_size'=>'medium', 'average_cost'=>'2' )
)
As I understood, I have to use CDetailView and for that first of all somehow I need to rearrange array like this? And maybe there are some build in function for that? Or I just can't find because there isn't? :(
array (
'0'=>array('year1'=>'2010', 'capacity1'=>'5', 'size1'=>'large', 'cost1'=>'1', ''=>'')
'1'=>array('year2'=>'2011', 'capacity2'=>'10', 'size2'=>'small','cost2'=>'2', 'average_capacity'=>'10' )
'2'=>array('year3'=>'1012', 'capacity3'=>'15', 'size3'=>'medium','cost3'=>'3', 'average_size'=>'medium')
)
Or maybe CDetailView is not what I need? There are not a lot of real examples about that view. Tried to find something about horizontal Cgridview where colums in usual usage are rows in my case, but no results. :(
Upvotes: 0
Views: 108