我有一个简单的查询
<button type="button" onclick="Joomla.submitbutton('propform.apply')">
<?php echo JText::_('JAPPLY') ?>
我想在应用功能之后将其重定向到新选项卡 - 有什么简单的方法可以实现这一点:(某种 onclick - 在应用功能之后重定向功能)?在此先感谢史蒂夫
如果您使用的是扩展 JControllerForm 的控制器,那么您可以通过覆盖保存函数来实现这一点。
public function save($key = null, $urlVar = null)
{
parent::save($key, $urlVar);
$task = $this->getTask();
if($task == 'apply') {
$this->setRedirect(
JRoute::_('index.php?option=com_mycomponent&view=anothertab', false)
);
}
}