Skip to content

Instantly share code, notes, and snippets.

@mbabker
Created June 21, 2011 04:42
Show Gist options
  • Save mbabker/1037259 to your computer and use it in GitHub Desktop.
Save mbabker/1037259 to your computer and use it in GitHub Desktop.
Batch Processing Boilerplate
/**
* Method to run batch operations.
*
* @return void
* @since 1.7
*/
public function batch($model)
{
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Set the model
$model = $this->getModel('Article', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_content&view=articles'.$this->getRedirectToListAppend(), false));
return parent::batch($model);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment