Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Which shold be the basic code to extend Userforms?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1119 Views
  • ShaggyStyle
    Avatar
    Community Member
    7 Posts

    Which shold be the basic code to extend Userforms? Link to this post

    I need to have different templates for diferent userforms... so the only way that I see is extending the userdefinedform class...

    As I see the next code is not enought.

    <?php
    class UserDefinedFormTienda extends UserDefinedForm {

    }

    class UserDefinedFormTienda_Controller extends Page_Controller {

       }

    }
    ?>

    Any idea please?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Which shold be the basic code to extend Userforms? Link to this post

    Hi

    It should be

    <?php
    class UserDefinedFormTienda extends UserDefinedForm {

    }

    class UserDefinedFormTienda_Controller extends UserDefinedForm_Controller {

    }

    In addition you had a spare closing bracket at the bottom of your code...

    After creating the file, don't forget to run dev/build

  • ShaggyStyle
    Avatar
    Community Member
    7 Posts

    Re: Which shold be the basic code to extend Userforms? Link to this post

    What a fool of me!!! I didn't noticed this detail. Thanks a lot

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