Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function createAction() {
- $form = new Zend_Form;
- $form->setAction($this->view->baseUrl().'/galerie/save')
- ->setMethod('post');
- if ($this->getRequest()->isGet()) {
- $reiseId = (int)$this->getRequest()->getParam('id_reise');
- }
- $form->addElement('text', 'name', array('label' => 'Name'));
- $form->addElement('textarea', 'beschreibung', array('label' => 'Beschreibung'));
- $image = new Zend_Form_Element_File('image');
- $image
- ->setLabel('Lad dein Foto hoch')
- ->setRequired(true)
- ->addValidator('Count', false, 1)
- ->addValidator('Size', false, 102400)
- ->addValidator('Extension', false, 'jpg,png,gif')
- ->addFilter('Rename',
- array(
- 'target' => $this->view->startUrl() . '/images/',
- 'overwrite' => true
- )
- );
- $form->addElement($image);
- $form->addElement('submit', 'save', array('label' => 'Speichern'));
- $form->addElement('hidden', 'id_reise', array('value' => $reiseId));
- $this->view->form = $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement