Пример #1
0
 public function testIsNotMultipartIfNoFieldIsMultipart()
 {
     $form = new Form('author');
     $form->add($this->createNonMultipartMockField('firstName'));
     $form->add($this->createNonMultipartMockField('lastName'));
     $this->assertFalse($form->isMultipart());
 }
 /**
  * Renders the HTML enctype in the form tag, if necessary
  *
  * Example usage in Twig templates:
  *
  *     <form action="..." method="post" {{ form_enctype(form) }}>
  *
  * @param Form $form   The form for which to render the encoding type
  */
 public function renderEnctype(Form $form)
 {
     return $form->isMultipart() ? 'enctype="multipart/form-data"' : '';
 }