![]() |
myth/auth - Call to undefined function logged_in() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: myth/auth - Call to undefined function logged_in() (/showthread.php?tid=76045) |
myth/auth - Call to undefined function logged_in() - BilltheCat - 04-09-2020 Hi all, Migrating from CI3, and I'm having trouble using the helper auth, while in the auth controller. I'm using a navbar with a login form that displays if the user isn't logged in, and this navbar displays on all pages including all of the authentication pages. Call to undefined function logged_in() Code: <?php if (!logged_in()) : ?> I installed myth/auth by composer, migrated all, and then renamed the AuthController to Auth: PHP Code: <?php namespace App\Controllers; In my BaseController I call the auth helper, so I think it 'should' load through each extending controller. Code: <?php RE: myth/auth - Call to undefined function logged_in() - BilltheCat - 04-10-2020 Never mind, I see that other are having the same issue (Myth:Auth Helper usage), so I followed the advise there. Added helper('auth') to my View template, and all is working now. |