Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » FormAction on CMS tab

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

Page: 1
Go to End
Author Topic: 981 Views
  • brettski
    Community Member
    1 Post

    FormAction on CMS tab Link to this post

    Hi all,

    I'm new to silverstripe, so please be gentle

    I'd like to add a FormAction button, or something similar, to a tab within the CMS. I've attached a screenshot of what I'd like...the functionality is obviously the part I'm having trouble with. I've got the code for sending emails and pulling subscribers from the database, but I can't figure out how to get the button to call the function I've defined for doing so.

    This code...

    $fields->addFieldToTab('Root.Content.Newsletter', new FormAction('SendEmail', 'Send Email to Newsletter Subscribers'));

    ...causes this error

    Fatal error: Call to undefined method SubscritionEmail::sendemail() in C:\xampp\htdocs\raes\sapphire\forms\Form.php on line 803

    My SendEmail function is defined in the same file as the $fields->addFieldToTab, etc is written.

    Is it possible to get the FormAction to call a function within the same page it is defined. ie, not calling back to Form.php?

    Thanks for your help

    Attached Files
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.