Welcome Guest, Not a member yet? Register   Sign In
Myth::Auth How to integrate provided views into app style

Hi All,

let me start with a great Thanks to the Developers for this awesome lib: myth auth !

I'm wondering which is the best way to integrate the provided views (login, registration, ...) into the user app style.

Following the readme you suggest to:

Quote:override the views used by editing Config/Auth.php, and changing the appropriate values within the $views variable:
public $views = [
    'login'     => 'Myth\Auth\Views\login',
    'register'  => 'Myth\Auth\Views\register',
    'forgot'    => 'Myth\Auth\Views\forgot',
    'reset'     => 'Myth\Auth\Views\reset',
    'emailForgot' => 'Myth\Auth\Views\emails\forgot',

If I correctly understand I should create my own views and change the $view variable to point at them, is it correct?

What's happen in case of lib updates?

Is there a way where I can style the provided views without creating new ones and be safe for future updates?


(This post was last modified: 02-27-2020, 06:37 AM by MGatner.)

I use a view layout (also in the Config) and use that to style and wrap the provided views.


OK I have to study how the view layouts works.

If you know some good example where to start will be really helpful.


Layouts are great, I definitely think they are worth learning. Think of them as views that other views can “snap into”, but they have the advantage that you can add content in multiple places (whereas traditionally if you had a view the echoes the header first you would get the whole header at once). Here’s a project where I use the Auth Config file to specify my own layout yet keep the default Myth view files:

I've followed the link to the manual section on Layouts kindly supplied by @MGatner but confess I don't understand it on first reading.

I wanted to swap the Auth navbar for a header & navbar used in other parts of the site I'm working on. I ended up changing a few lines in app/ThirdPary/myth-auth/src/Views/layout.php which did the trick but I'm pretty sure that's not a good way to do it.

PHP Code:
/* Comment out the Myth:Auth navbar */

/* Add the standard site header file / navbar */
$data = [
    'title' => 'Login',

How should I have done it?

@MGatner if you answer & recommend your bluesmith example could you explain it a bit more please?

Grateful for any other help / advice - thanks!

@MGatner Is the right way to do it in your example of Myth:Auth with the CodeIgniter Playground? Do I need to install that to find out or can it be easily explained without? Thanks!

I should probably start by overriding the provided views as described in the Myth:Auth README. And as advised read up about how views can be namespaced in CodeIgniter...

Theme © iAndrew 2016 - Forum software by © MyBB