# Action 事务操作 > action( $callback ) $callback [function] 事务内执行的方法. ~~~ $User = M("User"); $User->action(function($User) { $User->insert('User',array( "user" => "admin", "pass" => "admin" )); return true; //false 回滚 }); ~~~