Custom Block form post
Permalink
Hi,
I have a custom block which contains a form.
I need this form to post to an action in the controller. I have used the same code as a custom single page, but it wont post to the controller action..? Any guidance appreciated.
I have a custom block which contains a form.
I need this form to post to an action in the controller. I have used the same code as a custom single page, but it wont post to the controller action..? Any guidance appreciated.
<-- Code from view.php --> <form method="post" action="<?php echo $this->action('signup')?>" class="form-inline"> <label class="checkbox">Email:</label> <input type="text" class="input" name="email"> <button type="submit" class="btn">Continue</button> </form> <-- Code from controller.php --> <?php defined('C5_EXECUTE') or die(_("Access Denied.")); class EmailSignupBlockController extends BlockController { protected $btInterfaceWidth = "500"; protected $btInterfaceHeight = "350"; public function getBlockTypeName() { return t('Email Sign Up'); } public function getBlockTypeDescription() {
Viewing 15 lines of 24 lines. View entire code block.
or
Unlike single pages, actions in blocks need to have the prefix.