这是我的控制器(显然未完成,但要“做一些魔术”,我首先需要让它运行):
public function add($customer_id, $question_set_id, $order_value) {
$customer_id = $this->params['url']['customer_id'];
$question_set_id = $this->params['url']['question_set_id'];
$order_value = $this->params['url']['order_value'];
$possible_answer_model = ClassRegistry::init('PossibleAnswer');
$question_model = ClassRegistry::init('Question');
$order_model = ClassRegistry::init('Order');
$order = $order_model -> find('first', array(
'Order.question_set_id' => $question_set_id,
'Order.value' => $order_value));
$question = $question_model -> find('first', array(
'Question.id' => $order['Order']['question_id']));
$this -> set('question', $question);
if ($question['Question']['kind'] != "o") {
$this -> set('possible_answers', $possible_answer_model -> find('all', array(
'PossibleAnswer.question_id' => $question['Question']['id'])));
}
.
.
.
我得到的是:
警告 (2):缺少 AnswersController::add() 的参数 1 [APP\Controller\AnswersController.php,第 10 行]
警告 (2):缺少 AnswersController::add() 的参数 2 [APP\Controller\AnswersController.php,第 10 行]
警告 (2):缺少 AnswersController::add() 的参数 3 [APP\Controller\AnswersController.php,第 10 行]
我的链接是:
/answers/add/?customer_id=1&question_set_id=1&order_value=1