06.01
php
saved
dardosordi
Note
controller example for using with upload behaviour
model: http://bin.cakephp.org/view/1138231030
controller example for using with upload behaviour
model: http://bin.cakephp.org/view/1138231030
- <?php
- class FotosController extends AppController {
- var $name = 'Fotos';
- function admin_add($id = null) {
- $this->layout = 'admin';
- $this->cleanUpFields();
- $this->Foto->create();
- if($this->Foto->save($this->data)) {
- $this->Session->setFlash('The Foto has been saved');
- $this->redirect(array('controller' => 'galerias','action'=>'view', $this->data['Foto']['galeria_id']), null, true);
- } else {
- $this->Session->setFlash('The Foto could not be saved. Please, try again.');
- }
- }
- $galerias = $this->Foto->Galeria->generateList(null, null, null, '{n}.Galeria.id', '{n}.Galeria.nombre');
- $this->set('galeria', $id);
- }
- }
- ?>
Parsed in 0.054 seconds, using GeSHi 1.0.7.14