8.5.2 Pass variable from dashboard page controller to view

Permalink
Hi All,

I am trying to add a dashboard page and can't wrap my head around how to setup the controller and view.

This is what i have done.

I created a dashboard page called "opzeggen" in the folder:
/application/single_pages/dashboard/opzeggen.php

The content of opzeggen.php is:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?>
<?php var_dump ($success);?>


I created a controller for this page in the folder: /application/controllers/single_page/dashboard/opzeggen.php

The content of opzeggen.php is:
<?php 
namespace Application\Controller\SinglePage\Dashboard\Opzeggen;
use Concrete\Core\Page\Controller\DashboardPageController;
class Opzeggen extends DashboardPageController {   
    public function view() {
        $this->set('success', 'success');  
    }
}
?>


When visiting the dashboard page "Opzeggen" the $success variable outputs NULL instead of 'success';

Can anybody explain to me what I am doing wrong?
Thanks....

 
mnakalay replied on at Permalink Best Answer Reply
mnakalay
your controller's namespace should be
namespace Application\Controller\SinglePage\Dashboard;
smenster replied on at Permalink Reply
That's it. Thanks for answering!