Twitter Feed

Xataface Maillist

Sign up to receive the Xataface news letter with weekly updates and development tips.

 
Found 1 of 138 records in table Wiki
Now Showing 1 of 1

Current Record: after_action_new

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-2018 All rights reserved