Example #1
0
 public function forFile($pageId, $filename, $fieldName, $fieldType, $path)
 {
     $page = $this->page($pageId);
     $file = $page->file(File::decodeFilename($filename));
     if (!$file) {
         throw new Exception(l('files.error.missing.file'));
     }
     $form = $file->form('edit', function () {
     });
     return $this->route($file, $form, $fieldName, $fieldType, $path);
 }
Example #2
0
 protected function file($page, $filename)
 {
     $file = $page->file(File::decodeFilename($filename));
     if (!$file) {
         throw new Exception(l('files.error.missing.file'));
     }
     return $file;
 }