Advanced Module

edited August 2011 in Modules
I've been working my way though the Advanced Module tutorial also, and I'm trying to read the code from the other modules, but there is to much "other code". Any chance of a starting template for an Advanced Module that supports front end user view and Backend view? I've been able to get the backend to work somewhat, but I'm having problems with the front end. And I'm sure I've "hacked" it together to get the backend working..

Thanks

-Brad

Comments

  • edited 12:12PM
    The blog has that (albeit it's a pretty big module and has a lot of "other code"). Perhaps this will help... think of your advanced module folder like any other application directory.

    Front end controllers just need to extend the CI_Controller. In the blog module we created, we setup a default controller for them to inherit so it would load in the configs and setup common controller methods (e.g. _render).

    Any backend controllers need to extend the Fuel_base_controller so that they will check for an authenticated user. They should also have a proper route in place so that http://localhost/fuel/my_module works. FUEL will automatically load any routes located in the module's config folder with the name {module}_routes.php (e.g. fuel/modules/my_module/config/my_module_routes.php)

    Each module should at least have one controller with the same name as the module (e.g. fuel/modules/my_module/controllers/my_module.php). This controller will be what is executed when you browse to http://localhost/my_module/. This can be either a front end or backend controller. You can use routes to make the URIs look the way you want.

    Let me know if that helps.
  • edited August 2011
    Yes that helped some, I've got it all working except for the theme portion as of now. And I think I've got that covered, but I've run out of time.

    Thanks

    -Brad
Sign In or Register to comment.