Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/HtmlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,30 @@ public function script($url, $attributes = [], $secure = null)
return $this->toHtmlString('<script' . $this->attributes($attributes) . '></script>');
}

/**
* Generate a single or group of link to a JavaScript file.
*
* @param string $url
* @param array $attributes
* @param bool $secure
*
* @return \Illuminate\Support\HtmlString
*/
public function scripts($url, $attributes = [], $secure = null)
{
if (is_array($url)) {
$arr = [];

foreach ($url as $key => $value) {
$arr[] = $this->script($value, $attributes, $secure);
}

return implode("\r\n", $arr);
} else {
return $this->script($url, $attributes, $secure);
}
}

/**
* Generate a link to a CSS file.
*
Expand All @@ -101,6 +125,30 @@ public function style($url, $attributes = [], $secure = null)
return $this->toHtmlString('<link' . $this->attributes($attributes) . '>');
}

/**
* Generate a single or group of link to a CSS file.
*
* @param string $url
* @param array $attributes
* @param bool $secure
*
* @return \Illuminate\Support\HtmlString
*/
public function styles($url, $attributes = [], $secure = null)
{
if (is_array($url)) {
$arr = [];

foreach ($url as $key => $value) {
$arr[] = $this->style($value, $attributes, $secure);
}

return implode("\r\n", $arr);
} else {
return $this->style($url, $attributes, $secure);
}
}

/**
* Generate an HTML image element.
*
Expand Down