Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Yii:显示数据库中所有信息的代码_Php_Yii - Fatal编程技术网

Php Yii:显示数据库中所有信息的代码

Php Yii:显示数据库中所有信息的代码,php,yii,Php,Yii,我对YII框架真的很陌生,所以请大家容忍我。=) 这是我的密码 public function actionList() { $Employee = new employee; $data = array('employee' => $Employee); $this->render('Employee_Display', $data); } <tbody> <tr> <?php foreach($

我对YII框架真的很陌生,所以请大家容忍我。=) 这是我的密码

    public function actionList()
{
$Employee = new employee;

$data = array('employee' => $Employee);
$this->render('Employee_Display', $data);
}



        <tbody>
    <tr>
        <?php foreach($employee as $row): ?>
        <td><?php $row['employee_firstname']; ?></td>
        <?php endforeach; ?>

    </tr>
</tbody>
public function actionList()
{
$Employee=新员工;
$data=数组('employee'=>$employee);
$this->render('Employee_Display',$data);
}
我想获取员工姓名列表并以表格形式显示。

公共职能行动列表()
   public function actionList()
    {
      $Employee = employee::model()->findAll();
      $data = array('employee' => $Employee);
      $this->render('Employee_Display', $data);
    }
        <tbody>
    <tr>
        <?php foreach($employee as $row): ?>
        <td><?php $row->employee_firstname; ?></td>
        <?php endforeach; ?>

    </tr>
</tbody>
{ $Employee=Employee::model()->findAll(); $data=数组('employee'=>$employee); $this->render('Employee_Display',$data); }
我有一个错误,先生,因为这是一个实例,我认为应该这样做$result=$Employee->findall();