当前位置: 首页>>代码示例>>PHP>>正文


PHP Form::getFiles方法代码示例

本文整理汇总了PHP中Symfony\Component\DomCrawler\Form::getFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getFiles方法的具体用法?PHP Form::getFiles怎么用?PHP Form::getFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\DomCrawler\Form的用法示例。


在下文中一共展示了Form::getFiles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeRequestUsingForm

 protected function makeRequestUsingForm(Form $form)
 {
     $files = [];
     $plainFiles = $form->getFiles();
     foreach ($plainFiles as $key => $file) {
         $files[$key] = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error'], true);
     }
     return $this->makeRequest($form->getMethod(), $form->getUri(), $form->getValues(), [], $files);
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:9,代码来源:IntegrationTestCase.php

示例2: convertUploadsForTesting

 /**
  * Convert the given uploads to UploadedFile instances.
  *
  * @param  \Symfony\Component\DomCrawler\Form  $form
  * @param  array  $uploads
  * @return array
  */
 protected function convertUploadsForTesting(Form $form, array $uploads)
 {
     $files = $form->getFiles();
     $names = array_keys($files);
     $files = array_map(function (array $file, $name) use($uploads) {
         return isset($uploads[$name]) ? $this->getUploadedFileForTesting($file, $uploads, $name) : $file;
     }, $files, $names);
     return array_combine($names, $files);
 }
开发者ID:hanifn,项目名称:laravel-framework,代码行数:16,代码来源:InteractsWithPages.php

示例3: makeRequestUsingForm

 /**
  * Make a request to a URL using form parameters.
  *
  * @param  Form $form
  * @return static
  */
 protected function makeRequestUsingForm(Form $form)
 {
     return $this->makeRequest($form->getMethod(), $form->getUri(), $form->getValues(), [], $form->getFiles());
 }
开发者ID:sabahtalateh,项目名称:laracast,代码行数:10,代码来源:LaravelTestCase.php

示例4: convertFormFiles

 /**
  * Converts form files to UploadedFile instances.
  *
  * @param  Form $form
  * @return array
  */
 protected function convertFormFiles(Form $form)
 {
     $files = $form->getFiles();
     $names = array_keys($files);
     $files = array_map(function ($file, $name) {
         if (isset($this->files[$name])) {
             $absolutePath = $this->files[$name];
             $file = new UploadedFile($file['tmp_name'], basename($absolutePath), $file['type'], $file['size'], $file['error'], true);
         }
         return $file;
     }, $files, $names);
     return array_combine($names, $files);
 }
开发者ID:descubraomundo,项目名称:Integrated,代码行数:19,代码来源:LaravelTestCase.php

示例5: convertUploadsForTesting

 /**
  * Convert the given uploads to UploadedFile instances.
  *
  * @param  \Symfony\Component\DomCrawler\Form  $form
  * @param  array  $uploads
  * @return array
  */
 protected function convertUploadsForTesting(Form $form, array $uploads)
 {
     $files = $form->getFiles();
     $names = array_keys($files);
     $files = array_map(function (array $file, $name) use($uploads) {
         return isset($uploads[$name]) ? $this->getUploadedFileForTesting($file, $uploads, $name) : $file;
     }, $files, $names);
     $uploads = array_combine($names, $files);
     foreach ($uploads as $key => $file) {
         if (preg_match('/.*?(?:\\[.*?\\])+/', $key)) {
             $this->prepareArrayBasedFileInput($uploads, $key, $file);
         }
     }
     return $uploads;
 }
开发者ID:laravel,项目名称:framework,代码行数:22,代码来源:InteractsWithPages.php


注:本文中的Symfony\Component\DomCrawler\Form::getFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。