Before 3.1.5 I used to create a routes.yml with:
Director:
rules:
'custom//$Action/$ID/$Name': 'Custom_Controller'
And then a Custom_Controller.php file with:
class Custom_Controller extends Page_Controller {
In the custom controller I would make public function with code like:
$data = $data = array(
"Title" => "My title",
"Content" => "My content
);
return $this->customise($data)->renderWith(array('CustomTemplate', 'Page'));
Because I extended the Page_Controller I would still have the Sitetree navigation in the page.
As with 3.1.5 this shows me a login screen with the message:
Log in
You must log in with your CMS password in order to view the draft or archived content. <a href="/Custom_Controller/?stage=Live">Click here to go back to the published site.</a>
I actually see the link typed out like that
If I extend just je Controller it works fine:
class Custom_Controller extends Controller {
But now I don't have access to the stuff in my Page_Controller. I have to add all the requirements in the init() of the controller and I have no navigation anymore.
Before 3.1.5 the Page_Controller method worked perfectly! What changed and what is the best practice for this sort of thing?
Thanks in advance.