5.7 controllers for single_pages confusion
Permalink
I can not seem to get a crontroller to work for a single_page.
I have a single page called Newsroom
/applications/single_pages/newsroom/view.php
and i have the controller in ...
/applications/controllers/single_page/newsroom/controller.php
for the record, I have also put the controller in
and I have tried many versions of controller.php
Can someone please share how the 57 singlepage controllers need to be to work? I followed the examples on the Migration Guide, and either I missed something or they don’t apply to single_pages
I have a single page called Newsroom
/applications/single_pages/newsroom/view.php
and i have the controller in ...
/applications/controllers/single_page/newsroom/controller.php
namespace Application\Controller\SinglePage\Newsroom; use Controller; print "TEST";exit; class Newsroom extends Controller { public function view() { $this->set('test', 'works'); } }
for the record, I have also put the controller in
/applications/controllers/newsroom/controller.php /concrete/controllers/newsroom/controller.php /applications/single_pages/newsroom/controller.php
and I have tried many versions of controller.php
namespace Application\Controller\SinglePage\Newsroom; namespace Application\SinglePage\Newsroom; namespace Application\Controller\SinglePage\Newsroom; use Controller; use Page; use Single; use SinglePage; class Newsroom extends Controller { class NewsroomController extends Controller { class Newsroom extends PageController { class Controller extends Single { class Controller extends Page { many more, ad nauseam...
Can someone please share how the 57 singlepage controllers need to be to work? I followed the examples on the Migration Guide, and either I missed something or they don’t apply to single_pages
These threads also helped
http://www.concrete5.org/community/forums/customizing_c5/5.7-single...
http://www.concrete5.org/community/forums/5-7-discussion/single-pag...
in applications/single_pages/news.php
in applications/controllers/single_page/news.php
Output =
Then, I created a new single page called “newsroom”
and changed the controller as per all the lines below
and I get
Call to undefined method Concrete\Core\Page\Controller\PageController::getFoo()
And THEN….
I moved the controller to the newsroom subdir
(which obviously where it really belongs)
and when through the many iterations of possible namespaces and class names, and got the same “Call to undefined method Concrete\Core\Page\Controller\PageController::getFoo()”
So, the upshot is, in 57, I can ONLY create view in the single_pages top dir and controllers ONLY in the controllers/single_pages top dir, contrary to both documentation and c5.6 :(