Empty Advanced Module

edited October 2012 in Feature Requests
Hi, I am used to working with CI, so I was looking for a good CMS to build my apps with Codeigniter benefits.
The tutorial/documentation for the simple module is working well but I can't figure out how to create a module with an own controller and access it via url.

Can somebody please explain or provide an empty advanced module to use?

Comments

  • edited 5:55AM
    If you are using 0.93 (the master branch), you can follow the directions here:
    http://www.getfuelcms.com/user_guide/modules/advanced

    Basically, all you really need to do is create a new folder under the fuel/modules folder that has your controllers, helpers, libraries, views, etc folders and have a controller be the same name as your folder so you can access it at:
    localhost/{my_module}

    You then can add routes, constants and configs as you need.

    The v1.0 beta version provides a simpler way for you to create them by using the command line. Below is an example that would generate an "examples" module at fuel/modules/examples:
    php index.php fuel/generate/advanced/ examples

    More can be found in the 1.0 user guide. 1.0 doesn't include the user guide module by default (which is an advance module and can be looked at as an example), but you can check it out and install it at "fuel/modules/user_guide" and it will show up within the CMS on the left menu. More information is on the 1.0 installation page.
    https://github.com/daylightstudio/FUEL-CMS/tree/1.0
    https://github.com/daylightstudio/FUEL-CMS-User-Guide-Module
  • edited 5:55AM
    I have FUEL CMS in a subdirectory and will check your hints out.
    Do you recommend using 1.0 ? I have 0.93 now.
  • edited 5:55AM
    Okay, I've found the answer to my problem. My class had a constructor but didn't have an index method. So it was going through some routing I guess.
  • edited 5:55AM
    I'm recommending it now. We are using it for our projects internally for the last several months and provides a number of bug fixes and features not in 0.93. We are hoping to release the 1.0 version soon.
  • edited 5:55AM
    Okay. I'll take a look at the new versions. Do I need a license for commercial use? How about a permission for branding remove?

    I like the approach and consider using it for our clients.
  • edited 5:55AM
    FUEL is under the Apache 2.0 license (there site looks to be down at the moment). This basically means you can use it as you see fit, you just need to retain the original copyright information.
    http://www.apache.org/licenses/LICENSE-2.0
  • edited 5:55AM
    Okay, thank you for your answer.
    Now I try to do the following things:

    I want to create a new advanced module and have all files for it located in my folder inside /fuel/modules/. I want my controller,config, layouts and views to be there.

    I've figured out how to make the config and controllers. (By the way: 'module_uri' doesn't want to work)

    So how do you set the working/current directory for views and layouts inside the controller index method?
  • edited 5:55AM
    Try setting a "view_location" property in your controller class to the name of your module.
    public $view_location = 'my_module';
  • edited 5:55AM
    This doesn't work.
  • edited 5:55AM
    How are you loading the view files? Are none of these working from your controller?
    // explicitly pulls from module #1 $this->load->module_view('my_module', 'my_view, $vars); // explicitly pulls from module #2 $this->load->view( 'my_module/my_view, $vars); // auto detects if you are using a controller from the same module $this->load->view( 'my_view, $vars);
  • edited 5:55AM
    Well #2 does work. I am planning to develop 2 modules. One for a image gallery with categories and one for a simple cart.

    Do you want me to make some kind of tutorial for it?
  • edited 5:55AM
    That would be great. Let me know if you have any further questions. Post back when you are done and we can tweet it out.
Sign In or Register to comment.