Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function ajax_index(){
- $this->autoRender = false;
- if ($this->request->is('ajax')){
- Sanitize::clean($this -> request -> data['Participant']);
- $clean_data = array();
- $clean_data['vote'] = $this->Session->read('id');
- $this -> Participant -> set($clean_data);
- if ($this -> Participant -> save($clean_data)) {
- return true;
- }
- else{
- $errors = "";
- foreach($this->Participant->validationErrors as $key => $val){
- foreach ($val as $index => $error_msg){
- $errors .= $error_msg . "<br />";
- }
- }
- return $errors;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement