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:

<?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

micrdy
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi micrdy,

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.
alinpop replied on at Permalink Reply
Hi guys,

I have the same problem, any solutions?
MrKDilkington replied on at Permalink Reply
MrKDilkington
@alinpop

Please include specific details about your problem.

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.