Skip to content

Commit

Permalink
Add support for options array to Page::renderView()
Browse files Browse the repository at this point in the history
  • Loading branch information
teppokoivula committed Jan 10, 2024
1 parent dc1ffc9 commit 88736da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 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.28.0] - 2024-01-10

### Added
- Page::renderView() now accepts an array of options as second argument, behaving same as Page::render() when passed an array of options.

## [0.27.1] - 2023-10-12

### Changed
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.27.1",
"version": "0.28.0",
"author": "Teppo Koivula",
"href": "https://wireframe-framework.com",
"requires": [
Expand Down
2 changes: 1 addition & 1 deletion 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.27.1
* @version 0.28.0
* @author Teppo Koivula <teppo@wireframe-framework.com>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down
6 changes: 3 additions & 3 deletions lib/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @internal This class is only intended for use within the Wireframe internals.
*
* @version 0.3.0
* @version 0.4.0
* @author Teppo Koivula <teppo@wireframe-framework.com>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down Expand Up @@ -174,8 +174,8 @@ protected function pageRenderView(HookEvent $event) {
$original_view = $event->object->_wireframe_view;
$original_view_template = $event->object->_wireframe_view_template;
$event->object->_wireframe_layout = '';
$event->object->setView($event->arguments[0]);
$event->return = $event->object->render();
$event->object->setView($event->arguments(0));
$event->return = $event->object->render($event->arguments(1));
$event->object->_wireframe_layout = $original_layout;
$event->object->_wireframe_view = $original_view;
$event->object->_wireframe_view_template = $original_view_template;
Expand Down

0 comments on commit 88736da

Please sign in to comment.