Welcome Guest, Not a member yet? Register   Sign In
Always start a particular service...
#6

Currently there is not a way to automatically load Services. Helpers are fairly simple to do since they don't have to be assigned to any specific variable within the class, but not so with Services. The way this was discussed internally, is that most of the time it would happen through a base controller that your other controllers extend from, or, if you needed it within many functions of the controller, you would grab an instance during __construct and assign it to a class property. This seemed like the best option, based on code we'd all seen where everything gets autoloaded for every controller in the application whether it's needed or not. That, and we didn't want to auto-assign class property names based on the service name since it may conflict with other stuff you're doing.
Reply


Messages In This Thread
Always start a particular service... - by Tripex - 09-29-2017, 07:40 AM
RE: Always start a particular service... - by kilishan - 10-02-2017, 06:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB