将%附加到下拉数组中的值

时间:2018-11-27 22:57:21

标签: php cakephp-3.0

我有一个下拉数组,我想在选项中使用%符号。虽然不知道如何去做。我正在使用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,]);

但这不起作用...它只是在显示下拉菜单中的数字。

0 个答案:

没有答案