Controller not recognized for dashboard single_page
Permalink
Hi guys,
I checked the tutorial on creating single pages and the view file is ok, but the controller is not recognized. Any help is appreciated!
Folder structure:
-- application
---- single_pages
------ dashboard
-------- products
---------- view.php
---- controllers
------ single_page
-------- dashboard
---------- products
------------ controller.php
I did try clearing the cache and refreshing the page in the "Single Pages"
controller.php is not recognized by the view page. I tried to write echo, die or create error and nothing happens.
I checked the tutorial on creating single pages and the view file is ok, but the controller is not recognized. Any help is appreciated!
Folder structure:
-- application
---- single_pages
------ dashboard
-------- products
---------- view.php
---- controllers
------ single_page
-------- dashboard
---------- products
------------ controller.php
I did try clearing the cache and refreshing the page in the "Single Pages"
controller.php is not recognized by the view page. I tried to write echo, die or create error and nothing happens.
Yes, but what if I want to add multiple pages like dashboard/products, dashboard/add/products, dashboard/edit/products ?
I read some tutorial where they do recommend using folders in such occasions.
In the mean time I will try also your suggestion.
I read some tutorial where they do recommend using folders in such occasions.
In the mean time I will try also your suggestion.
For 5.7 in those cases you should do something like this:
-- application
---- single_pages
------ dashboard
-------- products
------------ add.php
------------ edit.php
-------- products.php
---- controllers
------ single_page
-------- dashboard
---------- products
-------------- add.php
-------------- edit.php
---------- products.php
-- application
---- single_pages
------ dashboard
-------- products
------------ add.php
------------ edit.php
-------- products.php
---- controllers
------ single_page
-------- dashboard
---------- products
-------------- add.php
-------------- edit.php
---------- products.php
Ok, so I did the changes you suggest and the view and controller run altogether, but:
I cannot set the variable from controller to show in the view.
here is my Controller:
and the view:
I cannot set the variable from controller to show in the view.
here is my Controller:
and the view:
echo "VAR = ".$variable;
Your namespace isn't right
namespace Application\Controller\SinglePage\Dashboard;
Perfect!
Thanks mate!
I tried to follow this tutorialhttps://www.concrete5.org/documentation/developers/5.7/working-with-... but somehow I didn't catch the correct ideas.
Thanks mate!
I tried to follow this tutorialhttps://www.concrete5.org/documentation/developers/5.7/working-with-... but somehow I didn't catch the correct ideas.
-- application
---- single_pages
------ dashboard
-------- products.php
---- controllers
------ single_page
-------- dashboard
---------- products.php