Where to place Services? |
I am wondering what's the best practice or convention for a location wherein to store custom 'Services'?
E.g. Authentication service. If I may suggest a change to docs, adding in this info under Services would be helpful.
The docs cover it pretty well already. Put your custom services stuff in /app/Config/Services.php
(05-18-2020, 08:24 PM)dave friend Wrote: The docs cover it pretty well already. Put your custom services stuff in /app/Config/Services.php Thanks for the reply, Dave. The docs cover how to register or define Services. What I am asking is where should one store the Class files in terms of best practices?
(05-19-2020, 04:07 AM)Zark Wrote: What I am asking is where should one store the Class files in terms of best practices? I prefer to keep the configuration files in app/Config/. The class files can be anywhere which is a nice change from CI v3. That said, I put them in app/Libraries more often than not. If multiple files are involved a subfolder to app/ is used, e.g. app/MyModule/. |
Welcome Guest, Not a member yet? Register Sign In |