By Joao Mimoso on Tuesday, 22 September 2015
Posted in General Issues
Replies 1
Likes 0
Views 412
Votes 0
Hello guys,

i've made an app with a form and im not able to route to the controller...

what is the command that i must put in the ACTION tag of the form to route to a specific Function of the controller??

<form id="feedbackInfo" action="" method="post">


I need to post some Vars to the controller and then redirect to the view again (see attached picture)

how to use the JRoute command?
Hi Joao Mimoso,

what is the command that i must put in the ACTION tag of the form to route to a specific Function of the controller??


You can use JRoute::_('index.php') in your form action property. Howerever, there is few more things you will need inside your form.


<input type="hidden" name="controller" value="apps" />
<input type="hidden" name="task" value="controller" />
<input type="hidden" name="appController" value="YOUR_APP_CONTROLLER_NAME" />
<input type="hidden" name="appTask" value="YOUR_TASKNAME_IN_YOUR_APP's_CONTROLLER" />
<input type="hidden" name="appId" value="<?php echo $app->id;?>" />
<input type="hidden" name="option" value="com_easysocial" />


Basically the above tell the request to submit to EasySocial's apps controller and from the apps controller, it will take the appController's name and appTask's name and redirect to your app's controller and execute the task name you've defined.

Hope this help
Sam
·
Wednesday, 23 September 2015 18:59
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post