Welcome Guest, Not a member yet? Register   Sign In
[split] Introduction to CodeIgniter 4 Blog Posts
#1
Photo 
(This post was last modified: 09-24-2018, 09:01 PM by titounnes.)

Hi Kilishan.
This section should be revised, since __construct was refacted to be initController.
Refactor controller to not use the constructor
PHP Code:
lass Home extends \CodeIgniter\Controller
{
public function 
__construct(...$params)
{
parent::__construct(...$params);
// This controller is only accessible via HTTPS
if (! $this->request->isSecure())
{
// Redirect the user to this page via HTTPS, and set the Strict-
Transport-Security
// header so the browser will automatically convert all links to this
page to HTTPS
// for the next year.
force_https();
}

Reply




Theme © iAndrew 2016 - Forum software by © MyBB