Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 extend core class process clarification
#2

(This post was last modified: 04-08-2024, 03:16 PM by kenjis.)

You are confusing.

The following code defines a new service named "get".
It does not extend Session::get().

PHP Code:
// app/Config/Services.php

namespace Config;

use 
CodeIgniter\Config\BaseService;

class 
Services extends BaseService
{
    public static function get($getShared true)
    {
        if ($getShared) {
            return static::getSharedInstance('get');
        }
        return new \App\Libraries\Session();
    }


See https://www.codeigniter.com/user_guide/e...he-service
Reply


Messages In This Thread
RE: Codeigniter 4 extend core class process clarification - by kenjis - 04-08-2024, 03:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB