Welcome Guest, Not a member yet? Register   Sign In
Extending the response class
#1

Hi,

i have an old MY_Output class from CI3. Now i want to create a class Response which extends the core Response class.
In App/Libraries i created the Response.php class

PHP Code:
<?php
namespace App\Libraries;

use 
CodeIgniter\HTTP\Response as CI_Response// because of duplicate symbol declaration

class Response extends CI_Response {
    public function 
my_function() {}


But i don't have access to my_function. In the documentation the new class is named identically. Do i have to load my library or does it happen automatically?
Reply
#2

You need to add your class in the Services.
See https://codeigniter4.github.io/CodeIgnit...he-service
Reply




Theme © iAndrew 2016 - Forum software by © MyBB