Encore\Admin\Form\Field\File::render PHP Method

render() public method

public render ( )
    public function render()
    {
        $this->js[] = 'bootstrap-fileinput/js/fileinput_locale_' . config('app.locale') . '.js';
        $this->options['initialCaption'] = basename($this->value);
        if (!empty($this->value)) {
            $this->options['initialPreview'] = $this->preview();
        }
        $options = json_encode($this->options);
        $this->script = <<<EOT

\$("#{$this->id}").fileinput({$options});

\$("#{$this->id}").on('filecleared', function(event) {
    \$("#{$this->id}_action").val(1);
});

EOT;
        return parent::render();
    }

Usage Example

コード例 #1
0
ファイル: Image.php プロジェクト: z-song/laravel-admin
 public function render()
 {
     $this->options(['allowedFileTypes' => ['image']]);
     return parent::render();
 }
All Usage Examples Of Encore\Admin\Form\Field\File::render