#1
How do you call another controller file in the same module
Example
Cars Module
--controllers/cars
--controllers/parts

Or do you use a sub module ?
Cars
--controller/cars.php
--Parts
----controllers/Parts.php

How would you reference the controller files in each scenario?
Thanks, Dan
#2
Hi Dan,

I could be wrong but I don't think having multiple controllers in the same module would work. I did read somewhere in the docs it is theoretically possible but not recommended.

I'd stick with super modules > https://trongate.io/docs_m/information/complete-video-tutorial and the written docs https://trongate.io/docs_m/information/what-are-super-modules-and-sub-modules. I also put a link showing how to quickly create them using the VSCode extension on Jake's YT channel.

and don't forget the MODULE_ASSETS_TRIGGER in the config.php
#3
Thanks Simon,
I set it up with the second file structure.
I'll look into the assets method.

David, You are right about either. Either way has the same amount of code. Maybe one has less folders. But in the end the Module with the Sub-Module worked for the Mailman Module.

Thanks,
Dan
#4
You didn't hear it from me but here's my worthless 2p:

The 'model' is just another controller. All code is a 'controller' - it facilitates the flow of data from one place/form to another.
MVC is just a construct - a theory on how it all works out for the best 'in the end' - bit like a religion. Have a little prayer now and then by all means but when you find yourself stoning people to death in the street, it's probably gone too far.
The best advice you'll get anywhere on any given topic is: Take what resonates and leave the rest.

"We are the music makers, And we are the dreamers of dreams"
#5
I gave Simon the Star because it is the closest answer. I liked his suggestion at the bottom.
Gavin, I would have actually split the answer to 2 winners. Yours is very Philosophical. I like it.
Thanks Everyone,
Dan
#6
Yep, that's 100% cool. Simon actually answered the question and David and I supplied the supporting theory. ?