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

Commit

Permalink
Change config option 'default_suffix' to 'extension' to match other r…
Browse files Browse the repository at this point in the history
…enderers
  • Loading branch information
Xerkus committed May 27, 2019
1 parent eb71018 commit b19ec47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @see https://github.com/zendframework/zend-expressive-zendviewrenderer for the canonical source repository
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
* @copyright Copyright (c) 2017-2019 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-expressive-zendviewrenderer/blob/master/LICENSE.md New BSD License
*/

Expand Down Expand Up @@ -38,7 +38,7 @@ public function getDependencies() : array
public function getTemplates() : array
{
return [
'default_suffix' => 'phtml',
'extension' => 'phtml',
'layout' => 'layout::default',
'paths' => [],
];
Expand Down
4 changes: 2 additions & 2 deletions src/ZendViewRendererFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public function __invoke(ContainerInterface $container) : ZendViewRenderer

$nsPathResolver = new NamespacedPathStackResolver();
// Set default suffix
if (isset($config['default_suffix'])) {
$nsPathResolver->setDefaultSuffix($config['default_suffix']);
if (isset($config['extension'])) {
$nsPathResolver->setDefaultSuffix($config['extension']);
}
$resolver->attach(
$nsPathResolver,
Expand Down
4 changes: 2 additions & 2 deletions test/ZendViewRendererFactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @see https://github.com/zendframework/zend-expressive-zendviewrenderer for the canonical source repository
* @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (https://www.zend.com)
* @copyright Copyright (c) 2015-2019 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-expressive-zendviewrenderer/blob/master/LICENSE.md New BSD License
*/

Expand Down Expand Up @@ -256,7 +256,7 @@ public function testConfiguresCustomDefaultSuffix()
{
$config = [
'templates' => [
'default_suffix' => 'php',
'extension' => 'php',
],
];

Expand Down

0 comments on commit b19ec47

Please sign in to comment.