/var/www/vhosts/ihelp.ro/_OLD/src/Controller
NameSizeModeActions
Component/-0755rm
AppController.php23300644editdlrm
CauseImagesController.php34080644editdlrm
CausesController.php21720644editdlrm
ErrorController.php17680644editdlrm
PagesController.php6160644editdlrm
ProfilesController.php43200644editdlrm
UsersController.php56490644editdlrm
Edit: /var/www/vhosts/ihelp.ro/_OLD/src/Controller/CauseImagesController.php (3408B)
paginate($this->CauseImages); $this->set(compact('causeImages')); } /** * View method * * @param string|null $id Cause Image id. * @return \Cake\Http\Response|null|void Renders view * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. */ public function view($id = null) { $causeImage = $this->CauseImages->get($id, [ 'contain' => ['Causes'], ]); $this->set(compact('causeImage')); } /** * Add method * * @return \Cake\Http\Response|null|void Redirects on successful add, renders view otherwise. */ public function add() { $causeImage = $this->CauseImages->newEmptyEntity(); if ($this->request->is('post')) { $causeImage = $this->CauseImages->patchEntity($causeImage, $this->request->getData()); if ($this->CauseImages->save($causeImage)) { $this->Flash->success(__('The cause image has been saved.')); return $this->redirect(['action' => 'index']); } $this->Flash->error(__('The cause image could not be saved. Please, try again.')); } $this->set(compact('causeImage')); } /** * Edit method * * @param string|null $id Cause Image id. * @return \Cake\Http\Response|null|void Redirects on successful edit, renders view otherwise. * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. */ public function edit($id = null) { $causeImage = $this->CauseImages->get($id, [ 'contain' => [], ]); if ($this->request->is(['patch', 'post', 'put'])) { $causeImage = $this->CauseImages->patchEntity($causeImage, $this->request->getData()); if ($this->CauseImages->save($causeImage)) { $this->Flash->success(__('The cause image has been saved.')); return $this->redirect(['action' => 'index']); } $this->Flash->error(__('The cause image could not be saved. Please, try again.')); } $this->set(compact('causeImage')); } /** * Delete method * * @param string|null $id Cause Image id. * @return \Cake\Http\Response|null|void Redirects to index. * @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found. */ public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); $causeImage = $this->CauseImages->get($id); if ($this->CauseImages->delete($causeImage)) { $this->Flash->success(__('The cause image has been deleted.')); } else { $this->Flash->error(__('The cause image could not be deleted. Please, try again.')); } return $this->redirect(['action' => 'index']); } }