Single page view and controller dont work fine
PermalinkI start from very simple example:
Application/single_pages/example.php
<?php echo $myColor;
Application/controllers/example.php
<?php namespace Application\Controller\SinglePage; use Concrete\Core\Page\Controller\PageController; class ExampleController extends Controller { public function view(){ $color=red; $this->set('myColor',$color); } }
Last step i Add this single page succsefully inside C5 admin:
dashboard/pages/single/single_page_added
Example: Why i dont get any error with code like this?
Application/controllers/example.php
<?php ///bad code example namespaceeeeeee Application\Controller\SinglePageeeeeeeeeee; useeeeee PageControllerrrrrrrrr; clllllllllllllass Example extendssssss PageController { public function vieeeeeeeeeeeeeeeew(){ $color=red; $ttthis->set('myColor',$colorrrrrrrrr; } }
How to delete forever unused single pages from this list?
/dashboard/pages/single
I delete some pages from site map and now i see this path:
/!trash/example
if you correct your code like below it should work:
1- you can simply reference "PageController" instead of the whole path (not an error, just better)
2- Your file is example.php so the class name should be Example, not ExampleController
3- the class should extend PageController, not Controller