From fb06cc0075d524cd42bfd7495b2f9aa458e91ef8 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 5 Jan 2017 13:03:18 +1300 Subject: [PATCH 1/2] API Change Page_Controller to PageController (PSR-2 compliance) --- mysite/code/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysite/code/Page.php b/mysite/code/Page.php index 0775444..d03bf83 100755 --- a/mysite/code/Page.php +++ b/mysite/code/Page.php @@ -12,7 +12,7 @@ class Page extends SiteTree { ); } -class Page_Controller extends ContentController { +class PageController extends ContentController { /** * An array of actions that can be accessed via a request. Each array element should be an action name, and the From e9a4095c9a07d83ec960dfc0a66cd2c005549a6d Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 5 Jan 2017 13:07:23 +1300 Subject: [PATCH 2/2] PSR-2 compliance: Move PageController class to its own file --- mysite/code/Page.php | 33 ++------------------------------- mysite/code/PageController.php | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 31 deletions(-) create mode 100644 mysite/code/PageController.php diff --git a/mysite/code/Page.php b/mysite/code/Page.php index d03bf83..9437a93 100755 --- a/mysite/code/Page.php +++ b/mysite/code/Page.php @@ -1,41 +1,12 @@ - * array ( - * 'action', // anyone can access this action - * 'action' => true, // same as above - * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action - * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true - * ); - * - * - * @var array - */ - private static $allowed_actions = array ( - ); - - public function init() { - parent::init(); - // You can include any CSS or JS required by your project here. - // See: https://docs.silverstripe.org/en/developer_guides/templates/requirements/ - } - } diff --git a/mysite/code/PageController.php b/mysite/code/PageController.php new file mode 100644 index 0000000..fa4547d --- /dev/null +++ b/mysite/code/PageController.php @@ -0,0 +1,31 @@ + + * array ( + * 'action', // anyone can access this action + * 'action' => true, // same as above + * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action + * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true + * ); + * + * + * @var array + */ + private static $allowed_actions = array( + ); + + public function init() + { + parent::init(); + // You can include any CSS or JS required by your project here. + // See: https://docs.silverstripe.org/en/developer_guides/templates/requirements/ + } +}