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;
}

var disqus_identifier = ‘xataface.com/wiki/after_action_new’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘http://xataface.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })(); blog comments powered by Disqus

//<![CDATA[ (function() { var links = document.getElementsByTagName(‘a’); var query = ‘?’; for(var i = 0; i < links.length; i++) { if(links[i].href.indexOf(‘#disqus_thread’) >= 0) { query += ‘url’ + i + ‘=’ + encodeURIComponent(links[i].href) + ‘&’; } } document.write(‘