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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

redirect search result


Go to End


2 Posts   1165 Views

Avatar
bebabeba

Community Member, 193 Posts

23 July 2010 at 4:08am

Edited: 23/07/2010 4:14am

Hi!
I create a form that make a query in my db. I have search form in ArticlePage (page type 1) and I want show data in AccountsPage (page type 2). Both of them extend Page. After search my url become this http://.../articlepage/accountspage ant this isn't correct..I want the result of my search here http://.../accountspage. I write my code here..

function Ricerca() {

$fields1 = new FieldSet(
new TextField(
$name = "Testo:", $title = "", $value = "")
);

$actions = new FieldSet(
new FormAction('doRicerca', 'CERCA')
);

return new Form($this, 'Ricerca', $fields1, $actions);
}

So in my ArticlePage.ss I write $Ricerca.

This is my action:
function doRicerca($data, $form) {
....query..
$array_data='result of my query';
return $this->customise(array('Linkx' => $array_data))->renderWith(array('AccountsPage', 'Page'));
}

In my AccountsPage.ss i write $Linkx but this seems don't work..How can redirect my result to AccountsPage?
Help!!

Avatar
swaiba

Forum Moderator, 1899 Posts

23 July 2010 at 7:15am

Might this help...

http://doc.silverstripe.org/searchcontext?s[]=pagination