Passed
Push — master ( f5f59c...7a263d )
by Ferry
04:39
created

HTMLHelper::makeFileUpload()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 7
c 1
b 0
f 0
nc 2
nop 5
dl 0
loc 8
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: User
5
 * Date: 8/14/2019
6
 * Time: 1:19 PM
7
 */
8
9
namespace crocodicstudio\crudbooster\helpers;
10
11
12
class HTMLHelper
13
{
14
15
    /**
16
     * @param $label
17
     * @param $name
18
     * @param $value
19
     * @param array $options
20
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
21
     */
22
    public function makeFileUpload($label, $name, $value = null, $required = true, array $options = []) {
23
        $data = [];
24
        $data['value'] = $value;
25
        $data['name'] = $name;
26
        $data['label'] = $label;
27
        $data['required'] = $required;
28
        $data['encrypt'] = isset($options['encrypt'])?$options['encrypt']:true;
29
        return view("crudbooster::html_helper.file_uploader.index", $data);
30
    }
31
32
    /**
33
     * @param $label
34
     * @param $name
35
     * @param $value
36
     * @param array $options
37
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
38
     */
39
    public function makeImageUpload($label, $name, $value = null, $required = true, array $options = []) {
40
        $data = [];
41
        $data['value'] = $value;
42
        $data['name'] = $name;
43
        $data['label'] = $label;
44
        $data['required'] = $required;
45
        $data['encrypt'] = isset($options['encrypt'])?$options['encrypt']:true;
46
        @$data['resizeWidth'] = $options['resize_width'];
47
        @$data['resizeHeight'] = $options['resize_height'];
48
        return view("crudbooster::html_helper.image_uploader.index", $data);
49
    }
50
51
}