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

Commit

Permalink
Merge branch 'feature/138' into develop
Browse files Browse the repository at this point in the history
Close #138
  • Loading branch information
weierophinney committed Jan 17, 2018
2 parents 2340694 + 44cd292 commit bb9075d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file, in reverse
- [#135](https://github.com/zendframework/zend-view/pull/135) adds support
for PHP 7.2.

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

### Changed

- [#133](https://github.com/zendframework/zend-view/pull/133) modifies the
Expand Down
3 changes: 2 additions & 1 deletion src/Helper/HeadLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class HeadLink extends Placeholder\Container\AbstractStandalone
'extras',
'itemprop',
'crossorigin',
'integrity'
'integrity',
'as',
];

/**
Expand Down
6 changes: 6 additions & 0 deletions test/Helper/HeadLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,10 @@ public function testItempropAttributeIsSupported()
$this->helper->prependAlternate(['itemprop' => 'url', 'href' => '/bar/baz', 'rel' => 'canonical']);
$this->assertContains('itemprop="url"', $this->helper->toString());
}

public function testAsAttributeIsSupported()
{
$this->helper->headLink(['as' => 'style', 'href' => '/foo/bar.css', 'rel' => 'preload']);
$this->assertContains('as="style"', $this->helper->toString());
}
}

0 comments on commit bb9075d

Please sign in to comment.