js_controller & advanced modules
Hi, I have an advanced module (newsletter), with sub-models. The config array for these is declared in the "newsletter_fuel_modules" file, but how do you set the js_controller to work from the advanced module assets folder, not the \fuel\modules\fuel\assets\js\fuel\controller directory? I've got this in the advanced module
$config['modules']['articles'] = array(
'model_location' => 'newsletter',
'module_uri' => 'newsletter/articles',
'js_controller' => 'fuel.controller.ArticlesController'
);
but the model seems to expect the controller file to be loaded as per a simple module.
Comments
'js_controller_path' => js_path('','articles');
You'll also either need to change the controller to be either just "ArticlesController" to live at fuel/modules/articles/assets/ArticlesController.js or it will need to live at fuel/modules/articles/assets/fuel/controller/ArticlesController.js given it's current object path.
'js_controller_path' => js_path('','newsletter');
OK that all works nicely, and is much tidier.