-- Paweł Chuchmała <[EMAIL PROTECTED]> wrote
(on Tuesday, 02 September 2008, 12:47 PM +0200):
> Another question.
> Why, if Form_Element_File is submitted with empty,
> $form->getValue('element_file') give me string
> with path to directory, where file should be write?
>
> In my opinion it should return empty string.
There's already an issue in the tracker to change this behavior.
> On Mon, Sep 1, 2008 at 18:57, Thomas Weidner <[EMAIL PROTECTED]> wrote:
> > Hy Pawel,
> >
> > Simply use multiple Form_Element_File's, one for each file, and assign the
> > returned filename to you custom array.
> > There is no need to subclass File_Transfer because it supports already
> > multiple files.
> >
> > Greetings
> > Thomas Weidner, I18N Team Leader, Zend Framework
> > http://www.thomasweidner.com
> >
> >
> > ----- Original Message ----- From: "Paweł Chuchmała"
> > <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Monday, September 01, 2008 4:41 PM
> > Subject: [fw-general] Zend_Form_Element_File, file transfer and request.
> >
> >
> >> Hi.
> >>
> >> I have some form. in controller i have:
> >>
> >> $form = new App_Form_UserDetails();
> >> if ($this->_request->isPost()) {
> >> if ($form->isValid($values)) {
> >> $user->setUserBasic($values);
> >> }
> >> } else {
> >> $form->populate($user->toForm($id));
> >> }
> >>
> >> $this->view->form = $form;
> >>
> >>
> >> Where $user is my model. and $values = $this->_request->getPost();
> >> $values = Array
> >> (
> >> [id] => 1
> >> [name] => Paweł Chuchmała
> >> )
> >>
> >> I want to add some Zend_Form_Element_File, for example 'photo',
> >> 'pet_photo', 'some_other_photo', and get $vallueas like this:
> >> $values = Array
> >> (
> >> [id] => 1
> >> [name] => Paweł Chuchmała
> >> [photo] => myphoto.jpg
> >> [pet_photo] = mypet.png
> >> [some_other_photo] = mysailingteam.jpg
> >> )
> >>
> >> How I can do this? Subclassing Zend_File_Transfer_Adapter_Http?
> >>
> >> regards,
> >>
> >> --
> >> Paweł Chuchmała
> >> pawel.chuchmala at gmail dot com
> >>
> >
> >
>
>
>
> --
> Paweł Chuchmała
> pawel.chuchmala at gmail dot com
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/