From a0bfbfc0d60cb351c9cec529322f172a6c8e0989 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Sat, 23 Aug 2014 17:23:29 +1000 Subject: [PATCH] CMS AJAX handlers now have a way to invoke the page cycle if desired --- CHANGELOG.md | 1 + modules/backend/classes/Controller.php | 2 +- modules/cms/classes/Controller.php | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff003fd1..28228927a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ * **Build 14x** (2014-08-xx) - Components and variables can now be accessed in the page code section via `$this->foo` in addition to `$this['foo']`. + - AJAX handlers in the CMS can now invoke the page cycle without rendering the page using `$this->pageCycle()`. * **Build 139** (2014-08-18) - List widget has been refactored to improve efficiency. diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index bc64d5868..dee0402d9 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -247,7 +247,7 @@ class Controller extends Extendable /** * Invokes the current controller action without rendering a view, - * used by AJAX handler who may rely on the logic inside the action. + * used by AJAX handler that may rely on the logic inside the action. */ public function pageAction() { diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index ae01bfc67..d9c0b873a 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -493,6 +493,15 @@ class Controller extends BaseController return false; } + /** + * Invokes the current page cycle without rendering the page, + * used by AJAX handler that may rely on the logic inside the action. + */ + public function pageCycle() + { + return $this->execPageCycle(); + } + /** * Executes the page life cycle. * Creates an object from the PHP sections of the page and