Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP: missing argument error, passing arguments via URL
    primarykey
    data
    text
    <p>This is my controller (unfinished obviously but to "do some magic" I first need to make it run):</p> <pre><code> public function add($customer_id, $question_set_id, $order_value) { $customer_id = $this-&gt;params['url']['customer_id']; $question_set_id = $this-&gt;params['url']['question_set_id']; $order_value = $this-&gt;params['url']['order_value']; $possible_answer_model = ClassRegistry::init('PossibleAnswer'); $question_model = ClassRegistry::init('Question'); $order_model = ClassRegistry::init('Order'); $order = $order_model -&gt; find('first', array( 'Order.question_set_id' =&gt; $question_set_id, 'Order.value' =&gt; $order_value)); $question = $question_model -&gt; find('first', array( 'Question.id' =&gt; $order['Order']['question_id'])); $this -&gt; set('question', $question); if ($question['Question']['kind'] != "o") { $this -&gt; set('possible_answers', $possible_answer_model -&gt; find('all', array( 'PossibleAnswer.question_id' =&gt; $question['Question']['id']))); } . . . </code></pre> <p>What I get is:</p> <blockquote> <p>Warning (2): Missing argument 1 for AnswersController::add() [APP\Controller\AnswersController.php, line 10]</p> <p>Warning (2): Missing argument 2 for AnswersController::add() [APP\Controller\AnswersController.php, line 10]</p> <p>Warning (2): Missing argument 3 for AnswersController::add() [APP\Controller\AnswersController.php, line 10]</p> </blockquote> <p>My link is:</p> <blockquote> <p>/answers/add/?customer_id=1&amp;question_set_id=1&amp;order_value=1</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload