Advanced Module with multiple models

edited February 2014 in Modules
I used the Fuel CLI to generate an advanced module with two generated simple modules.

php index.php fuel/generate/advanced promotion php index.php fuel/generate/simple leads promotion php index.php fuel/generate/simple orders promotion

The routes are set up and direct properly, however, the second simple module generated does not load in the admin view.

All I get is the spinning loader animation.

I have tried to re-generate the module, but every time it is the second generated simple module that has the issue.

Thoughts?

Github Gist: https://gist.github.com/kbjohnson90/9192232

Comments

  • edited February 2014
    Of course.... as soon as I finally post to the forum, I get something working.

    My observation:
    When an advanced module contains more than one simple module, then the file config/{module_name}_fuel_modules.php must contain more specific model information for each simple module.

    I originally assumed that the generated simple module configuration was sufficient for two simple modules, as the first of the two simple modules functioned properly.

    Am I correct in this observation?
    I am hoping to further my understanding of how advanced modules operate.

    Revised Gist: https://gist.github.com/kbjohnson90/9192232/revisions
  • edited 7:50AM
    Running the above should have generated the following in the fuel/modules/promotions/config/promotions_fuel_modules.php file:
    <?php $config['modules']['leads'] = array( 'preview_path' => '', // put in the preview path on the site e.g products/{slug} 'model_location' => 'promotions', // put in the advanced module name here ); $config['modules']['orders'] = array( 'preview_path' => '', // put in the preview path on the site e.g products/{slug} 'model_location' => 'promotions', // put in the advanced module name here );
    Does that look about right? Further module configuration will need to be made in that file.
  • edited 7:50AM
    Yes, that looks correct.

    I hadn't further configured:
    config/{module_name}_fuel_modules.php
    Adding that configuration solved the problem.
Sign In or Register to comment.