Welcome Guest, Not a member yet? Register   Sign In
[split] Modules Supported?

Also, you should be aware that in HMVC in CI3, when you call a controller method from another controller, your controller inherits the scope of the controller you call. I've had this come up a couple of times when I decided to take a shortcut and use Modules::Run() instead of extracting the method into a library or model, then found out that the controller's constructor was resetting some properties used in both controllers.

In the end, it was far easier, safer, etc. to move the method into another class and call it from both controllers, rather than use Modules::Run(). It also makes it significantly more obvious that the method might be accessed from other locations if it's in a library or model.

Messages In This Thread
[split] Modules Supported? - by qlj - 09-27-2016, 06:20 AM
RE: [split] Modules Supported? - by kilishan - 09-27-2016, 08:46 PM
RE: [split] Modules Supported? - by Narf - 09-28-2016, 01:09 AM
RE: [split] Modules Supported? - by mwhitney - 09-28-2016, 01:20 PM

Theme © iAndrew 2016 - Forum software by © MyBB