block view.php form action

Permalink
hi there

i'm currently building a small block with a form. in the view.php i've added
<?php echo $this->action('submit_form') ?>
to the method value of the form tag and in the controller is also
function action_submit_form()

unfortunately the method="" still keeps blank. what else do i have to do, to get the form working with my block controller?

thanks in advance
steff

Steff
 
Steff replied on at Permalink Reply
Steff
ok
i found someting. i have some functions in my controller to get some values back.
function getFormWidth(){
   return $this->formWidth;
}


i need this functions, to get the values back, if the block is added to the template.
it seams, that this functions touches something else which makes action_submit_form unavailable.

does any body know an other way, to get this problem solved? i really need the values, which are passed through the template to the controller.

so, any idea?
nerdess replied on at Permalink Reply
nerdess
hm, my action remains empty too if I add a block directly in a page template like so (because i want the same block to appear on multiple pages):

$form = BlockType::getByHandle('fancy_form');
$form->render('view');


However, if I add the same block the "normal" way as in "edit this page"->"add block"->"Fancy form" then the action looks nice like so

action="/index.php?cID=1&bID=27&arHandle=Main&ccm_token=1326728425:624b5c43c34b18c9e72d2eb2a65b7e2c&btask=passthru&method=submit_form"


could it be because the first approach is not properly adding the block?
zanedev replied on at Permalink Reply
zanedev
Yep it's definitely happening where
$this->action doesnt work in a block when called from code. I've searched all over the forums and it look like a common problem with no real solution yet. what a pain!
nicolaikr replied on at Permalink Reply
I can confirm that this is still an issue.
I've reported it on the bug-tracker
http://www.concrete5.org/developers/bugs/5-6-3-1/this-actionfunctio...