Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit bb9075d

Browse files
committed
Merge branch 'feature/138' into develop
Close #138
2 parents 2340694 + 44cd292 commit bb9075d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file, in reverse
99
- [#135](https://github.com/zendframework/zend-view/pull/135) adds support
1010
for PHP 7.2.
1111

12+
- [#138](https://github.com/zendframework/zend-view/pull/138) adds support for
13+
the HTML5 "as" attribute to the `HeadLink` helper. This can be used to help
14+
prioritize resource loading.
15+
1216
### Changed
1317

1418
- [#133](https://github.com/zendframework/zend-view/pull/133) modifies the

src/Helper/HeadLink.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class HeadLink extends Placeholder\Container\AbstractStandalone
5151
'extras',
5252
'itemprop',
5353
'crossorigin',
54-
'integrity'
54+
'integrity',
55+
'as',
5556
];
5657

5758
/**

test/Helper/HeadLinkTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,4 +457,10 @@ public function testItempropAttributeIsSupported()
457457
$this->helper->prependAlternate(['itemprop' => 'url', 'href' => '/bar/baz', 'rel' => 'canonical']);
458458
$this->assertContains('itemprop="url"', $this->helper->toString());
459459
}
460+
461+
public function testAsAttributeIsSupported()
462+
{
463+
$this->helper->headLink(['as' => 'style', 'href' => '/foo/bar.css', 'rel' => 'preload']);
464+
$this->assertContains('as="style"', $this->helper->toString());
465+
}
460466
}

0 commit comments

Comments
 (0)