我有一个下拉数组,我想在选项中使用%符号。虽然不知道如何去做。我正在使用Cakephp。
到目前为止(在控制器中):
case "Quiz":
$quiz = $this->CourseModules->FormTemplates->find('list')->where(['active'=>true,'type'=>'Quiz']);
$passMark = [100,90,80,70,60,50,40,30,20,10,0]; //find a prettier way to do this
$this->set('passMark',$passMark);
$this->set('quiz',$quiz);
break;
在.ctp文件中,我有:
echo $this->Form->input('pass_mark',['label'=>'Pass Mark','options'=> $passMark,]);
但这不起作用...它只是在显示下拉菜单中的数字。