Current Record: after_action_new #33

after_action_new trigger Table of Contents after_action_new trigger Signature Parameters Examples Example 1: Redirect to the view tab...

Current Record: after_action_new #33

after_action_new trigger Table of Contents after_action_new trigger Signature Parameters Examples Example 1: Redirect to the view tab...

after_action_new

[Permalink]

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:

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;
}
blog comments powered by Disqus
Powered by Xataface
(c) 2005-2024 All rights reserved