|
@@ 309-318 (lines=10) @@
|
| 306 |
|
* @param array $attributes |
| 307 |
|
* @return string |
| 308 |
|
*/ |
| 309 |
|
public function style($collection, array $filters = [], array $attributes = []) |
| 310 |
|
{ |
| 311 |
|
$defaults = ['media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet']; |
| 312 |
|
|
| 313 |
|
$attributes = $attributes + $defaults; |
| 314 |
|
|
| 315 |
|
$attributes['href'] = $this->path($collection, $filters); |
| 316 |
|
|
| 317 |
|
return '<link' . $this->html->attributes($attributes) . '>'; |
| 318 |
|
} |
| 319 |
|
|
| 320 |
|
/** |
| 321 |
|
* Return an array of script tags. |
|
@@ 349-364 (lines=16) @@
|
| 346 |
|
* @param array $attributes |
| 347 |
|
* @return array |
| 348 |
|
*/ |
| 349 |
|
public function styles($collection, array $filters = [], array $attributes = []) |
| 350 |
|
{ |
| 351 |
|
return array_map( |
| 352 |
|
function ($path) use ($attributes) { |
| 353 |
|
|
| 354 |
|
$defaults = ['media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet']; |
| 355 |
|
|
| 356 |
|
$attributes = $attributes + $defaults; |
| 357 |
|
|
| 358 |
|
$attributes['href'] = $path; |
| 359 |
|
|
| 360 |
|
return '<link' . $this->html->attributes($attributes) . '>'; |
| 361 |
|
}, |
| 362 |
|
$this->paths($collection, $filters) |
| 363 |
|
); |
| 364 |
|
} |
| 365 |
|
|
| 366 |
|
/** |
| 367 |
|
* Return an array of paths to an asset collection. |