function cancel() { $this->setRedirect(JRoute::_('index.php?option=com_igallery&view=images&catid=' . JRequest::GetInt('catid'), false)); }
$age = JRequest::getInt('age');
$id = JRequest::getInt('id', 0); // default value of 0 if ID is not setThis code would retrieve the ID value from the URL and return it as an integer. If the ID parameter does not exist in the URL, the method will return the default value of 0. The JRequest class is part of the Joomla Platform Package Library.
function cancel() { $this->setRedirect(JRoute::_('index.php?option=com_igallery&view=images&catid=' . JRequest::GetInt('catid'), false)); }