为什么 app_model.php 中的 afterSave() 总是在每次页面加载时触发?
class AppModel extends Model
{
public $cacheQueries = true;
var $actsAs = array('Containable');
function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
}
function afterSave($created) {
// Is used for better workflow when saving data
// Just for update
if(!$created) {
$_SESSION['redirect_update'] = true;
$_SESSION['redirect_to'] = $_SESSION['form_referer'];
debug('im always show on every page load!');
}
}
}