• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Myth::Auth How to integrate provided views into app style

#1
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:
Code:
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?

Grazie
Reply

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

https://codeigniter4.github.io/CodeIgnit...youts.html
Reply

#3
OK I have to study how the view layouts works.

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

Thanks!
Reply

#4
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:
https://gitlab.oit.duke.edu/academic-tec...g/Auth.php
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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