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: 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
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
OK I have to study how the view layouts works.
If you know some good example where to start will be really helpful. Thanks!
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
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: <?php 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!
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...
|
Welcome Guest, Not a member yet? Register Sign In |