<?php
namespace Extension;
 use TCMS\ControlExtension;
 use TCMS\TException;
 class UploadImageDefault extends ControlExtension {
 public $option = [ 'name' => null, 'multiple' => false, 'error' => false ];
 public function render($value, $option = null) {
 if($option == null || isset($option['name']) === false || empty($option['name'])) throw new TException("Vui lòng truyền vào option name cho extension upload-image-default", 501);
 copy_option($this->option, $option);
 $this->view->fileName = $value;
 $this->addScript(asset('/script/elfinder/elfinder.upload.js'));
 return $this->view('upload', $this->option);
 }
 }
 ?>