Single page controller for subpage, really can't figure it out, sorry.
Permalink
Hi,
I've tried every possible combination of controller folders and naming conventions, and all the examples i can find are single pages, with a single controller and 1 view.php thats full of ifs and switches.
What i got right now is 2 single pages who share a root 'region', so right now it shows:
Region
---------
IndexA
IndexB
I've added them, i can reach them, but i really got NO CLUE how to get the controllers working.
What i've tried:
controllers/dashboard/region/controller.php : function indexa()
controllers/dashboard/regionindexa/controller.php : function view()
controllers/dashboard/regionindexa/controller.php : function view()
controllers/dashboard/regionindexa.php : function view()
The interface obviously shows its possible, any1 know what im doing wrong? I really dont want everything in 1 view.php like the faq example
I've tried every possible combination of controller folders and naming conventions, and all the examples i can find are single pages, with a single controller and 1 view.php thats full of ifs and switches.
What i got right now is 2 single pages who share a root 'region', so right now it shows:
Region
---------
IndexA
IndexB
I've added them, i can reach them, but i really got NO CLUE how to get the controllers working.
What i've tried:
controllers/dashboard/region/controller.php : function indexa()
controllers/dashboard/regionindexa/controller.php : function view()
controllers/dashboard/regionindexa/controller.php : function view()
controllers/dashboard/regionindexa.php : function view()
The interface obviously shows its possible, any1 know what im doing wrong? I really dont want everything in 1 view.php like the faq example
Did you manage to fix this?
I'm having the same problem. I think there is a bug in 5.6 where the single page is located as a sub-page rather than directly underneath the homepage.
I'm having the same problem. I think there is a bug in 5.6 where the single page is located as a sub-page rather than directly underneath the homepage.
yes i did:
lets say you want this in the dashboard:
region
-------
viewa
viewb
/dashboard/region/viewa/
single_pages/dashboard/region/viewa.php (view)
controllers/dashboard/region/viewa.php and a function viewa() {} for the index
then a deeper action would simply mean another function in the same controller, or a controller in a deeper folder with a controller resembling that name and again the function with that same name.
lets say you want this in the dashboard:
region
-------
viewa
viewb
/dashboard/region/viewa/
single_pages/dashboard/region/viewa.php (view)
controllers/dashboard/region/viewa.php and a function viewa() {} for the index
then a deeper action would simply mean another function in the same controller, or a controller in a deeper folder with a controller resembling that name and again the function with that same name.
I still don't understand. Can you post your code please, or at least its outline?
Did you manage to fix this?
I'm having the same problem. I think there is a bug in 5.6 where the single page is located as a sub-page rather than directly underneath the homepage.
I'm having the same problem. I think there is a bug in 5.6 where the single page is located as a sub-page rather than directly underneath the homepage.
Hey dude,
I had the same problem and just figured it out. I looked at the controller names in the existing dashboard controllers and figured it out.
Here's my controller path
/controllers/dashboard/backend_stuff/investors/register.php
and my view path
/single_pages/dashboard/backend_stuff/investors/register.php
Now here's what made it start working for me.
I made a dashboard.php file in
/controllers/dashboard
and I named the register controller class relevant to it's path
I'm now able to get view() in register controller to fire on page view and access the other function with $this->action(''); in the view.
I hope this helps.
It drove me crazy!
I had the same problem and just figured it out. I looked at the controller names in the existing dashboard controllers and figured it out.
Here's my controller path
/controllers/dashboard/backend_stuff/investors/register.php
and my view path
/single_pages/dashboard/backend_stuff/investors/register.php
Now here's what made it start working for me.
I made a dashboard.php file in
/controllers/dashboard
and I named the register controller class relevant to it's path
I'm now able to get view() in register controller to fire on page view and access the other function with $this->action(''); in the view.
I hope this helps.
It drove me crazy!
So it would look like this in the file structure
Concrete 5.6
/controllers/dashboard/region/controller.php
/controllers/dashboard/region/indexa.php
/controllers/dashboard/region/indexb.php
Concrete 5.7
/application/controllers/single_page/dashboard/region.php
/application/controllers/single_page/dashboard/region/indexa.php
/application/controllers/single_page/dashboard/region/indexb.php