advanced modules and has many ($has_many) relationships

edited July 2014 in Modules
Hello,
I am new to fuel and enjoying what I have seen so far.
I am using it to create an admin for an image gallery application and in doing so have created an advanced module called gallery.
the module has 2 models: galleries and images where a user can create a gallery and then assign multiple images to it.

when I add the 'images' to the $has_many array, I get an error in gallery/galleries/create:
Unable to locate the file: images_model.php

I am wondering if I am understanding the advanced module concept properly as a wholly contained set of simple modules that could be moved between projects and who's modules have a relationship together?

Thank you for pointers in the right direction,
-NP

Comments

  • edited 1:35AM
    figured it out:
    i had to specify that the model was in the gallery folder (where gallery is the name of my advanced module):

    $has_many = array('images' => array('gallery/images_model'));

    would like to make sure i am on the right track conceptualizing advanced modules however.

    Thank you,
    -NP
  • edited 1:35AM
    You can also use this format to specify which advanced module to look in for the images_model:
    $has_many = array('images' => array('gallery' => 'images_model'));
  • edited 1:35AM
    aha, thank you!
    -NP
Sign In or Register to comment.