Welcome Guest, Not a member yet? Register   Sign In
Access $request in __construct in ResourceController?
#3

(This post was last modified: 12-17-2020, 09:03 AM by blaasvaer.)

Yes, that's why I hate that the CI team 'broke' __construct. We've all grown used to being able to use it like we expect to. And now, all of a sudden we have to 'adapt' to these weird custom approaches ... it's NOT good.

If I add your code ... my ResourceController just breaks!

WHAT am I supposed to be doing with it?

And WHY do I have to 'extend' a Controller in order to have access to the $request? It doesn't make ANY sense to me, at all!

Had to add this: public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)

But it still seems annoying and cumbersome to have to make all this basic stuff ... in order to access the request ... now when would a Controller NOT have a request? I cannot see the case for leaving this out.
Reply


Messages In This Thread
RE: Access $request in __construct in ResourceController? - by blaasvaer - 12-17-2020, 08:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB