function save() { JeaModelRealtors::save(); $id = JRequest::getInt('id', '', 'POST'); if ('apply' == $this->getTask()) { $this->_controllerUrl .= '&task=edit&id=' . $id; } else { $this->_setDefaultRedirect(); } $msg = JText::sprintf('Successfully saved realtor', $row['ten']); $this->setRedirect($this->_controllerUrl, $msg); }