我在cakePHP 2.我有一个问题,我需要你的帮助。这里是我的控制器(从StudentsController.php)的一些代码,特别是“编辑”功能:按变量筛选选定列表
$students = $this -> Student -> find('list', array(
'order' => 'Student.name ASC'
));
$this -> set('students', $students);
如何过滤当前学生的班级列表,以便该列表将包含具有相同的学生的所有学生类?
我需要这样的
$students = $this -> Student -> find('list', array(
'conditions' => array('Student.class_id' => CURRENT-STUDENT'S-CLASS),
'order' => 'Student.name ASC'
));
$this -> set('students', $students);
所以你有你正在编辑的学生的编号?你如何获得当前的学生类ID –
嗨科尔比,我需要用正确的代码替换** CURRENT-STUDENT'S-CLASS **,但我不知道:( – gonzo
显示您的整个编辑功能 –