Php Yii:显示数据库中所有信息的代码
我对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($
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();