Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

Routes & Main Controller / Specific Controller

$
0
0
Hello Fantastic CI community ! 

I'm actually stuck in my mind and i need your help if you have 5 minutes to give away in order to save my soul  Big Grin

I need a route like that : 

PHP Code:
$route['(:any)/(:num)'

But before to load a controller, i need to know which one and for that i need to check the info in the database regarding the ID i got (= (:num)). 
Cause i have a main table to list all the pages of the projects (around 100.000 pages) and in this main table, it's specified the related content table for each one. 

So first my idea was to do :

PHP Code:
$route['(:any)/(:num)'] = 'pages/pages_lookup_by_id/$2'

The Pages Controller is loaded and i can get all the informations, but after i don't know how to move to the specific controller (for example the Recipes Controller) cause there is no $this->load->controller() or something like that.

After, i had the idea to use a callback function in the routes file, to define the specific controller i need to load it directly. But it seems the callback function can not be used this way...

So i'm stuck Big Grin

Please save me !
Thanks a lot !

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>