【发布时间】:2011-03-09 12:37:14
【问题描述】:
我在下面有一个控制器类,它将一个学生添加到会话中。
类 StudentController 扩展 AppController { var $name="学生";
function addstudent()
{
//$id=$_REQUEST['id'];
//$this->Session->write('id', $id);
static $count=0;
if (!empty($this->data)) {
$students = $this->Session->read('Student');
if (!$students) {
$students = array();
}
$students[] = $this->data['Student'];/* data */
$this->Session->write('Student', $students);
$this->Session->write('student_count',$count);
$this->redirect(array('controller'=>'students','action' => 'addstudent'));
}
}
}
我的问题是如何在视图页面中显示所有添加的学生。请用语法解释我
【问题讨论】:
标签: cakephp