Skip to content

Commit

Permalink
Fix PHP deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
teppokoivula committed Mar 5, 2024
1 parent 77b91e1 commit 9fbdc18
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.29.1] - 2024-03-05

### Fixed
- PHP deprecation warning from passing null to basename().

## [0.29.0] - 2024-01-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion Wireframe.info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Wireframe",
"summary": "Wireframe is an output framework for ProcessWire CMS/CMF.",
"version": "0.29.0",
"version": "0.29.1",
"author": "Teppo Koivula",
"href": "https://wireframe-framework.com",
"requires": [
Expand Down
6 changes: 4 additions & 2 deletions Wireframe.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @method static string|Page|NullPage page($source, $args = []) Static getter (factory) method for Pages.
* @method static string|null partial(string $partial_name, array $args = []) Static getter (factory) method for Partials.
*
* @version 0.29.0
* @version 0.29.1
* @author Teppo Koivula <teppo@wireframe-framework.com>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down Expand Up @@ -826,7 +826,9 @@ public function ___render(array $data = []): ?string {
$view->setContext('view');
$output = $view->render();
}
if ($filename = basename($view->getLayout())) {
$layout = $view->getLayout();
$filename = $layout ? basename($layout) : null;
if ($filename) {
// layouts make it possible to define a common base structure for multiple otherwise separate template
// and view files (DRY)
$layout_filename = $paths->layouts . $filename . $ext;
Expand Down

0 comments on commit 9fbdc18

Please sign in to comment.