Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Search form error when submitting

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2007 Views
  • lubzee
    Avatar
    Community Member
    15 Posts

    Search form error when submitting Link to this post

    Hi

    I get the following error from my Search results() function that I pasted from tutorial-4 exactly into my page controller when I submit a search query.

    Missing argument 2 for Page_Controller::results()

    my page_controller results() function as follows where $form is undefined.

       function results($data, $form){
          $data = array(
             'Results' => $form->getResults(),
             'Query' => $form->getSearchQuery(),
             'Title' => 'Search Results'
          );   
          return $this->customise($data)->renderWith(array('Page_results', 'Page'));
       }

  • lubzee
    Avatar
    Community Member
    15 Posts

    Re: Search form error when submitting Link to this post

    Can someone that has the search explained in Tutorial-4 please explain to me how the $form argument in the results($data, $form) function gets defined or populated?

    I get missing argument 2 when calling the function.

    2007 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.