0

On a Magento2 admin page (order/view) I added a form using phtml file with block. I would like to define my form action to my controller url : www.xxx.com/admin_toto/foo/bar/index

How can I generate this url ?

<form id="test" method="post" action="<?php echo ADMIN_URL.'foo/bar/index'?>">
 <?php echo $block->getBlockHtml('formkey');?>
 <input>...</input>
 <span><button type="submit">Update</button></span>
</form>
Marius
199k55 gold badges431 silver badges837 bronze badges
asked Apr 7, 2017 at 15:00

1 Answer 1

4

try with

$block->getUrl('foo/bar/index');
answered Apr 7, 2017 at 15:02
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.