Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8235307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:45:48+00:00 2026-06-07T18:45:48+00:00

This is my controller (unfinished obviously but to "do some magic" I first need

  • 0

This is my controller (unfinished obviously but to "do some magic" I first need to make it run):

    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'])));
        }
.
.
.

What I get is:

Warning (2): Missing argument 1 for AnswersController::add() [APP\Controller\AnswersController.php, line 10]

Warning (2): Missing argument 2 for AnswersController::add() [APP\Controller\AnswersController.php, line 10]

Warning (2): Missing argument 3 for AnswersController::add() [APP\Controller\AnswersController.php, line 10]

My link is:

/answers/add/?customer_id=1&question_set_id=1&order_value=1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:45:49+00:00Added an answer on June 7, 2026 at 6:45 pm

    The link needs to be

    /answers/add/1/1/1
    

    in order to map to

    AnswersController::add($customer_id, $question_set_id, $order_value)
    

    Regular query parameters have to be accessed through $this->params inside the controller, they are not passed as arguments to the action.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting some unexpected behavior from Html.EditorFor(). I have this controller: [HandleError] public
i have this controller function: Public Function Index(ByVal id As System.Nullable(Of Integer)) As ActionResult
I have this controller function that returns cpu stats: public ActionResult GetStats() { Random
I'm trying to make an extension public static ActionResult RedirectToIndexAction(this Controller controller) { return
With this controller method: - [AcceptVerbs(HttpVerbs.Post)] public ViewResult Contact(Contact contactMessage) { return View(); }
I have this controller: public class StandingsController : Controller { public ViewResult Index(int id)
I've this controller public class AdminController : Controller { private IAdministratorService _administratorService; public AdminController(IAdministratorService
I have a simple Controller that looks like this:- @Controller @RequestMapping(value = /groups) public
I need to ignore routes matching this schema /{controller}/edit/undefined {controller} - could be any
I have this Controller : @Controller @RequestMapping(/path/*) public class MyController { @RequestMapping(value = /,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.