Merge branch '5.5' of github.com:LaravelCollective/html

This commit is contained in:
Tom Shafer committed 2018-02-05 08:09:29 -07:00
commit f9deb1da6f
3 files changed
+17 -4

No files matched your search

+11 -1
View File
@@ -190,6 +190,16 @@ class FormBuilder
{
$this->model = $model;
}
/**
* Get the current model instance on the form builder.
*
* @return mixed $model
*/
public function getModel()
{
return $this->model;
}
/**
* Close the current form.
@@ -729,7 +739,7 @@ class FormBuilder
{
$selected = $this->getSelectedValue($value, $selected);
$options = ['value' => $value, 'selected' => $selected] + $attributes;
$options = array_merge(['value' => $value, 'selected' => $selected], $attributes);
$string = '<option' . $this->html->attributes($options) . '>';
if ($display !== null) {
+3 -3
View File
@@ -94,7 +94,7 @@ class HtmlBuilder
{
$defaults = ['media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet'];
$attributes = $attributes + $defaults;
$attributes = array_merge($attributes, $defaults);
$attributes['href'] = $this->url->asset($url, $secure);
@@ -132,7 +132,7 @@ class HtmlBuilder
{
$defaults = ['rel' => 'shortcut icon', 'type' => 'image/x-icon'];
$attributes = $attributes + $defaults;
$attributes = array_merge($attributes, $defaults);
$attributes['href'] = $this->url->asset($url, $secure);
@@ -162,7 +162,7 @@ class HtmlBuilder
$title = $this->entities($title);
}
return $this->toHtmlString('<a href="' . $url . '"' . $this->attributes($attributes) . '>' . $title . '</a>');
return $this->toHtmlString('<a href="' . $this->entities($url) . '"' . $this->attributes($attributes) . '>' . $title . '</a>');
}
/**
+3
View File
@@ -118,8 +118,11 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase
$result2 = $this->htmlBuilder->link("http://www.example.com", "<span>Example.com</span>", ["class" => "example-link"], null, false);
$result3 = $this->htmlBuilder->link("https://a.com/b?id=4&not_id=5", "URL which needs escaping");
$this->assertEquals('<a href="http://www.example.com" class="example-link">&lt;span&gt;Example.com&lt;/span&gt;</a>', $result1);
$this->assertEquals('<a href="http://www.example.com" class="example-link"><span>Example.com</span></a>', $result2);
$this->assertEquals('<a href="https://a.com/b?id=4&amp;not_id=5">URL which needs escaping</a>', $result3);
}
public function testMailto()