1
我正在cakephp进行调查。这是我第一次使用cakephp,我偶然发现了一个问题,所以我需要一些建议。我想有多个答案选项(单选按钮),最后只有一个提交按钮。多个表单 - 一个提交按钮
我正在FormHelper,我的问题:我必须在我的数据库中输入每个问题,然后用cakephp获取它吗?或者可以将它放在我的HTML中,只需在cakephp中添加答案选项即可。
这是我现在有(HTML +的CakePHP的单选按钮)
但是当我尝试输入多个答案选项+问题,我得到这个:
我的代码:
<div class="question">
<div class="number">
<p>1</p>
</div>
<div class="questionI">
<p>The organization’s mission/purpose is absolutely clear</p>
</div>
<div class="answers">
<?php
echo $this->Form->create();
$options = array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10');
$attributes = array('legend' => false);
echo $this->Form->radio('answer1', $options, $attributes);
echo $this->Form->radio('answer2', $options, $attributes);
echo $this->Form->end('Submit');
?>
</div>
</div>
我的第二个问题是另一个问题的div,所以我知道我无法使他们的方式.. 我想这样做每个循环的,但后来我想我必须把每一个问题在我的数据库?
谢谢!当你解释它时似乎很简单:D – Jnb