5407 Posts in 1647 Topics by 1187 members
|Go to End|
21 June 2009 at 8:38pm
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.
$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
|Go to Top|