Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Search form error when submitting


Go to End


2 Posts   2877 Views

Avatar
lubzee

Community Member, 15 Posts

21 October 2008 at 1:25am

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

Avatar
lubzee

Community Member, 15 Posts

21 October 2008 at 8:40pm

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.