Dashboard Single Page Controller
Permalink
I need to develop a dashboard single page in 5.7. I did this in 5.6 a few times, but now I´m struggeling. My folder structure of the package (name is: directory) is:
directory/single_pages/dashboard/directory/view.php (here the view is rendered. works)
directory/controllers/single_page/dashboard/directory/controller.php
This is the code for the controller:
I should be able to echo $success in view.php. But it does not echo anything.
Where is my error?
Cheers
directory/single_pages/dashboard/directory/view.php (here the view is rendered. works)
directory/controllers/single_page/dashboard/directory/controller.php
This is the code for the controller:
<?php defined('C5_EXECUTE') or die("Access Denied."); namespace Concrete\Package\Directory\Controller\SinglePage\Dashboard; use \Concrete\Core\Page\Controller\DashboardPageController; class Directory extends DashboardPageController { public function view() { $this->set('success', 'My success message'); } }
I should be able to echo $success in view.php. But it does not echo anything.
Where is my error?
Cheers
I believe your controller path should look like this:
directory/controllers/single_page/dashboard/directory.php
Your controller.php should be renamed to directory.php.