CodeIgniter Forums
Routing on sub level menus - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Routing on sub level menus (/showthread.php?tid=70541)



Routing on sub level menus - alann - 04-25-2018

Hi everyone,

I'm a newbie with Codeigniter and am on my second attempt at a project. I've been really impressed with how easy it was to set up my views and database queries. However I'm stuck with my menu routing.

I have a menu with 4 levels such as:

accessories > audio-accessories > earpieces  > brand
accessories > batteries > nimh  > brand

etc

All are index pages.

I've followed the Codeigniter tutorial and have all my first level pages set up and working but after setting up a controller and routes for accessories I manage to get the first sublevel working but when trying the next using the same format I fail. I'm clearly missing something really fundamental.

Is anyone aware of a tutorial, or examples to do something like this?

Thank you in advance for any help or advice.

Alan


RE: Routing on sub level menus - InsiteFX - 04-25-2018

Read this, it may help you out.

Revisiting the multilevel menu in PHP with some additional code (as in… Bootstrap CSS)


RE: Routing on sub level menus - alann - 04-26-2018

(04-25-2018, 04:13 AM)InsiteFX Wrote: Read this, it may help you out.

Revisiting the multilevel menu in PHP with some additional code (as in… Bootstrap CSS)

Hi InsiteFX,

Thanks for your reply - a very useful article and I may have a play with this on something else I have coming up but I may not have been clear on what I was stuck with.

I already have the menu in place. I need to be able to route to the views. I'm OK with routing for base level urls such as home, about, contact etc as I have a page controller for that. I'm stuck with creating the routing to the 3 sub levels in the menu.

Thanks for taking the time to look though.

Regards,

Alan


RE: Routing on sub level menus - InsiteFX - 04-26-2018

You can use CodeIgniter's anchor Method in the url helper for that.

SEE: CodeIgniter User's Guide

anchor


RE: Routing on sub level menus - alann - 04-27-2018

(04-26-2018, 03:52 AM)InsiteFX Wrote: You can use CodeIgniter's anchor Method in the url helper for that.

SEE: CodeIgniter User's Guide

anchor

Hi InsiteFX,

Thankyou!

I'll take a look at this.

Regards,

Alan