• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
beta 2 - base_url() inconsistent in namespaces

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:

$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.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.