Posted By

welly on 07/06/09


Tagged

php textmate cakephp validate


Versions (?)

validate save code for importing csv file


 / Published in: PHP
 

  1. // $error = false;
  2.  
  3. // validate the row
  4. // $this->set($data);
  5. // if (!$this->Member->validates())
  6. // {
  7. // $this->_flash(__(sprintf('Post for Row %d failed to validate.',$i), true),'warning');
  8. // $error = true;
  9. // }
  10.  
  11. // save the row
  12. // if (!$error && !$this->Member->save($data))
  13. // {
  14. // $this->Member->_flash(__(sprintf('Post for Row %d failed to save.',$i), true),'warning');
  15. // }
  16.  
  17. // save the row
  18. // if (!$error)
  19. // {
  20. // // for more info on _flash() please visit:
  21. // // http://mrphp.com.au/node/1820
  22. // $this->Member->_flash(__(sprintf('Post for Row %d was saved.',$i), true),'success');
  23. // }
  24.  

Report this snippet  

You need to login to post a comment.