Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » redirect search result

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

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

Page: 1
Go to End
Author Topic: 818 Views
  • bebabeba
    Community Member
    192 Posts

    redirect search result Link to this post

    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) {
    $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?

  • swaiba
    Forum Moderator
    1792 Posts

    Re: redirect search result Link to this post

    Might this help...


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.