Welcome Guest, Not a member yet? Register   Sign In
beta 2 - base_url() inconsistent in namespaces
#2

base_url() should be the same from any namespace. So that definitely sounds like a bug. PLease file a bug report for that!

The request and response classes are only automatically inserted as a property in controllers, so $this->response is only available in controller, not model.

In my opinion you shouldn't be messing with response or requests from within a model, but if you want to, you can always grab the current instance through the services:

Code:
$request = \Config\Services::request();
$response = service('response')

There's two ways to grab a service so I showed both for example, but either way would work with any service.
Reply


Messages In This Thread
RE: beta 2 - base_url() inconsistent in namespaces - by kilishan - 04-12-2019, 11:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB