Migrer votre code de CodeIgniter 3 vers CodeIgniter 4

Les fichiers de configuration https://www.codeigniter.com/user_guide/libraries/config.html https://bcit-ci.github.io/CodeIgniter4/general/configuration.html Avant $this->config->load(‘ion_auth’); $this->config->item(‘admin_group’, ‘ion_auth’) Maintenant $this->configIonAuth = config(‘IonAuth’); $this->config->admin_group; Input / IncomingRequest Class https://www.codeigniter.com/user_guide/libraries/input.html https://bcit-ci.github.io/CodeIgniter4/incoming/incomingrequest.html $foo = $this->input->post(‘foo’)    // CI 3 $foo = $this->request->getPost(‘foo’);    // CI 4 $ipAddress = $this->input->ip_address(); devient // Dans un controlleur $ipAddress = $this->request->getIPAddress(); // AIlleurs $request = \Config\Services::request(); $ipAddress = $request->getIPAddress(); ou $ip_address =…
Lire la suite


15 octobre 2018 0