Passing parameters in Joomla 3.x
View to Controller
views/foo/tmpl.form.php
<input type="hidden" name="Itemid" value="<?php echo $itemid; ?>" />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
controllers/foo.php
public function save(){
$app = JFactory::getApplication();
$itemid = $app->input->getInt('Itemid');
$id = $app->input->getInt('id');
......
$link = "....Itemid={$itemid}"; // 'I' must be capital, which is weird....XD
$this->setRedirect($link,"Redirecting...");
}
URL to Model
using JInput:
public function getSome(){
$jinput = JFactory::getApplication()->input;
$itemid = $jinput->getInt('itemid', 0 );
$id = $jinput->getInt('id', 0 );
}
Written by teknonono
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Joomla
Authors
Related Tags
#joomla
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#