Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Something changed?

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: 554 Views
  • Victor
    Avatar
    Community Member
    128 Posts

    Something changed? Link to this post

    I have not touched this project for eternity and this thing worked in 2.3.0 but not in 2.3.3

    <?php
    class SeminarAll extends Page {
    static $db = array(
    );
    }

    class SeminarAll_Controller extends Page_Controller {

    function SeminarSearchFormAll(){
    return new Form(
    $this,
    "SeminarSearchFormAll",
    new FieldSet( new FormAction('doSeminarSearchAll','Display All Seminars'))
    );
    }

    function doSeminarSearchAll($data,$form){
    $results = new DataObjectSet();
    $resultss = DataObject::get("Seminar", "", "`seminardate`,`seminartimestart`");
    $results->merge($resultss);
    $results->sort('seminartimestart');
    $results->sort('seminardate');
    return $this->customise(array('SeminarSearchResults' => $results))->renderWith(array('SeminarSearch_results'));
    }
    }
    ?>

    It complains (in DevMode) about

    function doSeminarSearchAll($data,$form){

    but would not complain about
    function doSeminarSearchAll(){

    (albeit the latter does not work)

    Anything I am missing? Thank you in advance

    Victor

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Something changed? Link to this post

    The form actions should be the fourth parameter of the Form constructor (not the third as in your example).
    http://doc.silverstripe.org/doku.php?id=form

    function SeminarSearchFormAll(){
       return new Form(
          $this,
          "SeminarSearchFormAll",
          ... your form fields? ...,
          new FieldSet( new FormAction('doSeminarSearchAll','Display All Seminars'))
       );
    }

    554 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.