url 类型输入框

@param        $field
@param        $title
@param string $value
@return Input
160389
public static function url($field, $title, $value = '')
    {
        return self::input($field, $title, $value, Input::TYPE_URL);
    }
117321
public static function uploadImageOne($field, $title, $action, $value = '')
    {
        $upload = self::upload($field, $title, $action, $value, Upload::TYPE_IMAGE);
        $upload->format(['jpg', 'jpeg', 'png', 'gif'])->accept('image/*')->maxLength(1);
        return $upload;
    }
1345357
public function setField($field, $value = '')
    {
        if (is_array($field)) {
            $data = $field;
        } else {
            $data[$field] = $value;
        }
        return $this->update($data);
    }
266991
public function withHeader(string $field, string $value): self {
        $field = \trim($field);
        $lower = \strtolower($field);

        $clone = clone $this;

        $clone->headers[$lower] = [\trim($value)];
        $clone->headerCaseMap[$lower] = $field;

        return $clone;
    }
249006
private function buildField($field, $type, $variable, $value = true)
    {
        $column = strtolower($field['name']);
        $title = ucfirst($field['name']);

        if ($value === true) {
            $value = '$' . $variable . '->' . $column;
        } else {
            $value = 'old("'.$column.'")';
        }

        $syntax = [];

        switch($type) {
            case 'string':
            default:
                $input = 'text';
                break;
            case 'text':
                $input = 'textarea';
                break;
        }

        $syntax[] = '<div class="form-group @if($errors->has('."'". $column . "'".')) has-error @endif">';
        $syntax[] = '   <label for="' . $column . '-field">' . $title . '</label>';

        if($this->illuminate) {
            $syntax[] = '   {!! Form::' . $input . '("' . $column . '", ' . $value . ', array("class" => "form-control", "id" => "' . $column . '-field")) !!}';
        } else {
            $syntax[] = $this->htmlField($column, $variable, $field, $type);
        }

        $syntax[] = '   @if($errors->has("' . $column . '"))';
        $syntax[] = '    <span class="help-block">{{ $errors->first("' . $column . '") }}</span>';
        $syntax[] = '   @endif';
        $syntax[] = '</div>';

        return join("\n".str_repeat(' ', 20), $syntax);
    }
847823
public function load($field, $sourceUrl, $idField = 'id', $textField = 'text')
    {
        if (Str::contains($field, '.')) {
            $field = $this->formatName($field);
            $class = str_replace(['[', ']'], '_', $field);
        } else {
            $class = $field;
        }

        $script = <<<EOT

$(document).on('change', "{$this->getElementClassSelector()}", function () {
    var target = $(this).closest('.fields-group').find(".$class");
    $.get("$sourceUrl?q="+this.value, function (data) {
        target.find("option").remove();
        $(target).select2({
            data: $.map(data, function (d) {
                d.id = d.$idField;
                d.text = d.$textField;
                return d;
            })
        }).trigger('change');
    });
});
EOT;

        Admin::script($script);

        return $this;
    }
562566
public static function email($field, $title, $value = '')
    {
        return self::input($field, $title, $value, Input::TYPE_EMAIL);
    }
1086817
private function generateAttachmentField(string $title, $value): array
    {
        $value = is_array($value)
            ? sprintf('```%s```', $this->stringify($value))
            : $value;

        return array(
            'title' => ucfirst($title),
            'value' => $value,
            'short' => false,
        );
    }
279542
public function link($url, $title, $attributes = [])
    {
        $attributes['href'] = $url;
        $tag = new Tag('a', $attributes);
        $tag->setText($title);
        return $tag;
    }
1287394
public function setTotalsTitle($field, $title = 'Total: %s row%s')
    {
        $this->totals_title_field = $field;
        $this->totals_title = $title;

        return $this;
    }
701966
public function gt($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) > $value;
        };
    }
885797
protected function _link($page, $title)
    {
        $url   = $this->getObject('request')->getUrl();
        $query = $url->getQuery(true);

        //For compatibility with Joomla use limitstart instead of offset
        $query['limit']      = $page->limit;
        $query['limitstart'] = $page->offset;

        unset($query['offset']);

        $url->setQuery($query);

        if ($page->active && !$page->current) {
            $html = '<a href="'.$url.'">'.$this->getObject('translator')->translate($title).'</a>';
        } else {
            $html = '<a>'.$this->getObject('translator')->translate($title).'</a>';
        }

        return $html;
    }
505392
public static function uploadImages($field, $title, $action, array $value = [])
    {
        $upload = self::upload($field, $title, $action, $value, Upload::TYPE_IMAGE);
        $upload->format(['jpg', 'jpeg', 'png', 'gif'])->accept('image/*');
        return $upload;

    }
605387
public function url($field)
    {
        return (filter_var(trim($this->get($field)), FILTER_VALIDATE_URL) !== false) ?: $this->error($field,
            __FUNCTION__);
    }
739748
public static function month($field, $title, $value = '')
    {
        return self::datePicker($field, $title, (string)$value, DatePicker::TYPE_MONTH);
    }
916623
public function formatUrl($value)
	{
		$url=$value;
		if(strpos($url,'http://')!==0 && strpos($url,'https://')!==0)
			$url='http://'.$url;
		return CHtml::link(CHtml::encode($value),$url);
	}
188355
public static function upload($field, $title, $action, $value = '', $type = Upload::TYPE_FILE)
    {
        $upload = new Upload($field, $title, $value);
        $upload->uploadType($type)->action($action);
        return $upload;
    }