single page controller

Permalink
hi , i have a single page ( not in a package just a single page ).
i would like to give it a controller.

the single page is called backend.php and its located in

how would i extend the controller?

my controller page looks like this:

<?php 
defined('C5_EXECUTE') or die("Access Denied.");
class BackendController extends Controller {
   public function view() {
      $this->set('test', 'works');
   }
}
?>


thanks for your help.

 
INTcommunications replied on at Permalink Reply
INTcommunications
It doesn't say where your single page is in your question. If it is in a single_pages folder - then you need to match the controller with the same name in the controllers folder. So if you have a single page named backend.php in the single_pages folder - you would then need a backend.php in the controllers folder. This tells C5 where to go look for the controller. The path has to match up.
aryeh replied on at Permalink Reply
i have the single pages in the right spot.
however not working to display my $test attribute on it.
any other idea's? anything i may be doing wrong?