Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php echo $this->Form->create('Image',array('type' => 'file','url'=>array('controller'=>'images','action'=>'add'),'id'=>'imageForm')); ?>
- <?php echo $this->Form->file('image'); ?>
- <?php echo $this->Form->input('description',array('type'=>'text','id'=>'desc')); ?>
- <?php echo $this->Form->input('date', array('label' => 'Fin')); ?>
- <?php echo $this->Form->end('Ajouter') ?>
- -----------
- add action
- -----------
- if ($this->request->is('post')) {
- if(!empty($this->request->data["Image"]["image"]["tmp_name"]))
- {
- $this->Image->create();
- $this->Image->save($this->request->data);
- debug($this->Image);
- $this->Session->write("id_image",$this->Image->id);
- // $this->redirect($this->Session->read('last_page'));
- }
Add Comment
Please, Sign In to add comment