Php 用yii创建表

Php 用yii创建表,php,gridview,yii,Php,Gridview,Yii,我是Yii框架的新手。有人能教我如何将下表转换为Yii脚本格式吗 <table> <tr> <th>Stages</th> <th>Progress</th> <th>Action</th> </tr> <tr> <th>Stage 1</th> &

我是Yii框架的新手。有人能教我如何将下表转换为Yii脚本格式吗

<table>
    <tr>
        <th>Stages</th>
        <th>Progress</th>
        <th>Action</th>
    </tr>

    <tr>
        <th>Stage 1</th>
        <td>data from db</td>
        <td>data from db</td>
    </tr>

    <tr>
        <th>Stage 2</th>
        <td>data from db</td>
        <td>data from db</td>
    </tr>

   <tr>
       <th>Stage 3</th>
       <td>data from db</td>
       <td>data from db</td>
   </tr>
</table>

舞台
进展
行动
第一阶段
来自数据库的数据
来自数据库的数据
第二阶段
来自数据库的数据
来自数据库的数据
第三阶段
来自数据库的数据
来自数据库的数据
使用和


您可以使用
CGridView
将表转换为Yii脚本格式。 请参阅下面的代码

$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'stages-grid',
    'itemsCssClass'=>'table',
    'summaryCssClass'=>'panel-body',
    'dataProvider' => $model->search(),
    'columns' => array(
        array(
            'name' => 'stages',
            'header'=> 'Stages',
            'value' => $model->stages,
        ),
        array(
            'name' => 'stages1',
            'header'=> 'Stages 1',
            'value' => $model->stages1,
        ),
        array(
            'name' => 'stages2',
            'header'=> 'Stages 2',
            'value' => $model->stages2,
        ),
        array(
            'name' => 'stages3',
            'header'=> 'Stages 3',
            'value' => $model->stages3,
        ),

    ),
)); 

为Yii GridView分配数据和列,Yii使所有其他内容都可用。对于Yii,您可以使用GridView。我不知道如何创建第一行和第一列都是静态定义的表。有什么样的例子我可以参考吗?你可以用Yii-gridview来做,其余的事情都由Yii来处理。裁判。
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'stages-grid',
    'itemsCssClass'=>'table',
    'summaryCssClass'=>'panel-body',
    'dataProvider' => $model->search(),
    'columns' => array(
        array(
            'name' => 'stages',
            'header'=> 'Stages',
            'value' => $model->stages,
        ),
        array(
            'name' => 'stages1',
            'header'=> 'Stages 1',
            'value' => $model->stages1,
        ),
        array(
            'name' => 'stages2',
            'header'=> 'Stages 2',
            'value' => $model->stages2,
        ),
        array(
            'name' => 'stages3',
            'header'=> 'Stages 3',
            'value' => $model->stages3,
        ),

    ),
));