Adding External Form w/ Code
PermalinkBut my form is having issues finding it's controller file it would seem.
$a = BlockType::getByHandle('external_form'); $a->controller->filename = "innerpage_newsletter.php"; $a->render("forms/innerpage_newsletter");
When I check the paths using the external_form's main controller they re showing up correctly. However, when I submit the form It simply jumps back to the same page which would indicate that didn't know what the action call for my form was.
I'm sure everything else in the form is correct since if I add it the regular way everything works fine.
Any help is greatly appreciated!

<?php $block = Block::getByName('header nav'); if( $block && $block->bID ) $block->display(); ?>
It should be ok then, best to put in a print statement or something to ensure the function is being called in your controller and then work back from there.
-Scott
Thanks, but unfortunately your method needs that block to exist somewhere previously and what I'm trying to accomplish can't have that.
ScottC,
I may be misunderstanding you but I believe I've already done this. My form action calls for $this->action('add'). In my method for the controller file I have named it action_add.
I also tried $this->action('action_add') and naming the method simply 'add' and switching what matched with what in case I misunderstood you, but no results.
Thanks anyway guys, I will keep plugging at this and if you or anyone has any other tips it would be greatly appreciated.