after_action_new trigger
This trigger is called after the new action is successfully completed. This trigger can be defined in the table delegate class and is often used to redirect to a particular page after a new record is submitted. This should not be confused with the afterInsert trigger, which is executed after a record is inserted into the database (this can occur multiple times per request). The after_action_new trigger is only executed once after the ‘new’ action has been successfully completed. i.e. a maximum of once per request.
Signature
function after_action_new($params=array()){ ... } : return void
Parameters
This method takes a single associative array as a parameter. This array includes the following keys:
- record - The Dataface_Record object that was just inserted.
Examples
Example 1: Redirect to the view tab for the inserted record
function after_action_new($params=array()){
$record =& $params['record'];
header('Location: '.$record->getURL('-action=view').'&--msg='.urlencode('Record successfully inserted.'));
exit;
}