Welcome Guest, Not a member yet? Register   Sign In
Where to place Services?
#1

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.
Reply
#2

(This post was last modified: 05-18-2020, 08:25 PM by dave friend.)

The docs cover it pretty well already. Put your custom services stuff in /app/Config/Services.php
Reply
#3

(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?
Reply
#4

(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/.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB