single page controller not loading
Permalink
Hi
i made a single page and add it on single pages list on dashboard and cache is OFF
the single page loading ok
but when i make a controller on controllers/single_page folder with same name of the single page the controller is not loading !!
my single page is mokhtar.php and the controller code on controllers\single_page folder is
<?php
class MokhtarController extends Controller {
public function view() {
echo "this is a test line .....";
}
}
why controller code is not loading
i made a single page and add it on single pages list on dashboard and cache is OFF
the single page loading ok
but when i make a controller on controllers/single_page folder with same name of the single page the controller is not loading !!
my single page is mokhtar.php and the controller code on controllers\single_page folder is
<?php
class MokhtarController extends Controller {
public function view() {
echo "this is a test line .....";
}
}
why controller code is not loading
Is it possible that you need some namespacing there? Classes are loaded based on provided namespace (as far as I understand it).
what namespace i should write?
i wrote this line on my controller
namespace Concrete\Controller\SinglePage;
it gives me error
Class 'Concrete\Controller\SinglePage\Controller' not found !!
namespace Concrete\Controller\SinglePage;
it gives me error
Class 'Concrete\Controller\SinglePage\Controller' not found !!
the controller file is loaded well because when i write print line at the top of it it prints that line
but the view function is not working !!
but the view function is not working !!