Model name clash

edited December 2013 in Modules
Hi
I've used the authentication library ion_auth in a current Fuel build, for front-end login, and have just realised that when the model is added as a simple module to the Fuel admin, there is a url clash with the admin users model. Is there a way to alias the ion_auth users' model? I thought defining the module_uri might do it, but it doesn't change the link.

Comments

  • edited 11:03AM
    Is this with 0.93 or 1.0? In 1.0, the models have "fuel_" prefixed before it to prevent model name clashes like that.
  • edited 11:03AM
    It's v1. MY_Fuel_modules is specified as:
    $config['modules']['users'] = array( 'display_field' => 'last_name', 'module_name' => 'Site users', 'model_name' => 'users_model', 'module_uri' => 'members' );
    and of course there is also an entry in MY_Fuel for 'users'
  • edited 11:03AM
    Try changing the module key to "members":
    $config['modules']['members'] = array( 'display_field' => 'last_name', 'module_name' => 'Site users', 'model_name' => 'users_model', 'module_uri' => 'members' );
  • edited December 2013
    Hey that works!

    Tchoh! I'm so literal minded sometimes! Thanks. better still, I've renamed it to "site_users", which is more in keeping. Just in case anyone else reads this, I'll spell it out:
    // Defining ion_auth 'users' as a Fuel module $config['modules']['site_users'] = array( 'display_field' => 'last_name', 'module_name' => 'Site users', 'model_name' => 'users_model', // ion_auth model 'module_uri' => 'site_users' );

    Out of interest, the module_uri on it's own doesn't seem to have any effect - what does it do?
  • edited 11:03AM
    If you have an advanced module that has sub modules, like the blog advanced module that has a blog_posts sub modules, you can set the URI to match what you've set the route too. In the this example, that is blog/posts (instead of blog_posts).
Sign In or Register to comment.