Welcome Guest, Not a member yet? Register   Sign In
How to 'protect' Controller?
#1

Hi,

I'm taking serious baby steps here ... none of my 'knowledge' from CI3 seem to apply anywhere in CI4 (I know it's a complete rewrite).



I've created an AdminController which extends the BaseController. In that AdminController I've added a __construct:


Code:
protected $helpers = ['url'];

public function __construct ()
{
    $logged_in = false;

    if ( ! $logged_in ) {
        return redirect('App\Controllers\Home::index');
    }
}


I'm having another controller extends this ... but I simply cannot get my head around WHY it's not redirecting as 'expected'?

What is it that I'm completely missing about CI4 despite having read the docs over and over and over and over again and again and again?
Reply


Messages In This Thread
How to 'protect' Controller? - by blaasvaer - 09-02-2020, 02:18 PM
RE: How to 'protect' Controller? - by demyr - 09-03-2020, 12:46 AM
RE: How to 'protect' Controller? - by blaasvaer - 09-03-2020, 12:50 AM
RE: How to 'protect' Controller? - by demyr - 09-03-2020, 01:50 AM
RE: How to 'protect' Controller? - by blaasvaer - 09-03-2020, 01:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB