myth-auth: Helper not loading in BaseController - Call to undefined function logged_in()

Sorry for my ignorance, but I can’t get the auth helper to load sitewide. Added auth to helpers in BaseController, but still get the error Call to undefined function logged_in(). I dont want to add <?php helper('auth');?> in all my views, nor in any controller class. In fact I need it in the layout and there is no controller for that. Should I be adding it to your AuthController.php, as it works when in there, although I wouldn’t want to edit any of your source files (apart from config to change to my own views). Thanks

class BaseController extends Controller
{
    protected $helpers = ['auth'];

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

I didn’t know how to add it in Events, until you sent that link above, so now I know I have done that and its working. Looks a better approach than overriding AuthController, so thanks a lot for your help.