• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Introduction to CodeIgniter 4 Blog Posts

#1
Photo 
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.