$this->redirect(OW::getRouter()->urlForRoute('pluginName.pageName'));
php file:
$whatever = $this->service->goSaveSomething($values);
if($whatever)
{
//the item was saved, show confirm message and redirect user
$this->redirect(OW::getRouter()->urlForRoute('pluginName.pageName'));
}else{
//the item was not saved and show error and redirect user or not
$this->redirect(OW::getRouter()->urlForRoute('pluginName.pageName'));
}//close else
In bol service php
function goSaveSomething($data)
{
$didWeSave = pluginName_BOL_FilenameDao::getInstance()->save($data);
return $didWeSave;
}
in bol Dao file
function save($thedata)
{
$isSaved = save process
return $isSaved;
}
u get the idea, return from each function and then check for value in php file, it should be 1 or 0 in most cases, 1 true = success 0 false = failed then show error or confirm message and redirect accordingly.