Method problem within 'Single Page' controller
Permalink
Hi all,
I'm messing around with single pages and controllers and I got the following problem:
I want to create an edit page and an add page with just one file instead of multiple files. So I read the documentation and it says when I use methods like add() and edit() I can simply use the urls /example/add and /example/edit/. But instead of doing that, it always shows the view.php. Regardless the edit() and add() methods and yes, the files are there, add.php and edit.php. I give up! Can somebody help me out here?
Many thanks!
This is my code:
I'm messing around with single pages and controllers and I got the following problem:
I want to create an edit page and an add page with just one file instead of multiple files. So I read the documentation and it says when I use methods like add() and edit() I can simply use the urls /example/add and /example/edit/. But instead of doing that, it always shows the view.php. Regardless the edit() and add() methods and yes, the files are there, add.php and edit.php. I give up! Can somebody help me out here?
Many thanks!
This is my code:
<?php namespace Concrete\Package\Test\Controller\SinglePage\Dashboard\Test; use Database; use Concrete\Core\Page\Controller\DashboardPageController; class Example extends DashboardPageController { public function view() { $this->set('content', 'This is the view page'); } public function add() { $this->set('content', 'This is the add page'); } public function edit($id = false)
Viewing 15 lines of 19 lines. View entire code block.