Learning advanced modules: the BLOG module

edited June 2011 in Feature Requests
Hello,
I'm studying the BLOG module in order to better understand advanced modules, but I'm left scratching my head on how to actually interpret the blog's routing as in blog/config/blog_routes.php


$blog_controllers = array('posts', 'comments', 'categories', 'links', 'users');

foreach($blog_controllers as $c)
{
$route[FUEL_ROUTE.'blog/'.$c] = FUEL_FOLDER.'/module';
$route[FUEL_ROUTE.'blog/'.$c.'/(.*)'] = FUEL_FOLDER.'/module/$1';
}

What happens when i go to /fuel/blog/posts ? This route seems to redirect ALL trailing segments to fuel/module but i can't figure out what that means... Is it a way of telling Fuel to search for MODELS inside the module's folder with the same name as in the URI segment (i.e. /fuel/blog/posts goes to /fuel/blog/models/blog_posts_model.php ?)

I'm trying to understand what that "module" part does in the routes...

Thanks!

Comments

  • edited 2:43PM
    The module controller will grab information from a key value from the URI and then will initiate module parameters found in the fuel/modules/blog/config/blog_fuel_modules.php. Most modules will use that controller for handling the create/edit/delete etc of the module data. In some cases it is extended (e.g. the pages controller).
  • edited 2:43PM
    Thanks!!! now i get it!
Sign In or Register to comment.