external_form controller function in single page

Permalink
Hi there

I have a page with a external_form block on a page, loading my form. This is a donation form. After filling the form, a div is exposed. In this div, an iFrame is loaded the credit card company payment form. After filling this form, the iFrame content gets to a pagehttp://www.site.com/CCForm. this CCForm is a single page. As far, every thing works perfect.
In the external_form controller for the donation form is a send_mail function. I now would like to call this function by the singel page.

I have allready loaded the external_block with the donation form with this code.
$b = Block::getByID(944);


unfortunately, i can not access the send_mail functino by using:
$b->action('send_mail');


i get:
Fatal error: Call to undefined method Block::action()


Does any one have an idea, how i can access the 'send_mail' function of the external_form donation form controller?

Thanks for your help and kind regards,
Steff

Steff
 
Steff replied on at Permalink Reply
Steff
As usual.

If you are looking for a solution for two hours, and then decide to write a forum post, you'll find the solution within the next 30minutes.

OK. Here it is.

This is what i've added to the single_page
$b = Block::getByID(944);
$cnt = $b->getController();
$cnt->send_mail();


And this is the whole magic.

Kind regards,
Steff