Welcome Guest, Not a member yet? Register   Sign In
modifying BaseController.php for libraries

(This post was last modified: 06-22-2023, 07:52 AM by richb201.)

I am trying to autoload libraries in BaseController.php. Is DoNotEditThisLine really just a comment?

public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
        // Do Not Edit This Line
        parent::initController($request, $response, $logger);   <<this line is causing an error. Is this really just a comment?

        // Preload any models, libraries, etc, here.
        protected $libraries=[
proof that an old dog can learn new tricks

CodeIgniter 4 User Guide - CodeIgniter4 Overview Autoloading Files
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

You cannot remove the line "parent::initController($request, $response, $logger);".
If you do it, Controllers won't work.

You cannot use "protected" keyword in class methods in PHP.

Theme © iAndrew 2016 - Forum software by © MyBB