CodeIgniter Forums
What is best practice to modify Vendor views? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: What is best practice to modify Vendor views? (/showthread.php?tid=86076)



What is best practice to modify Vendor views? - munggaran - 01-06-2023

Let say I set new CI4 instance, then put Shield (Auth) with composer which reside under Vendor folder.
CI4 will autoload Shield including all "Pre-made" views (login+forgot password+register+etc)
So how to move Views for our main project instead "Vendor's belonging?, because if we modify those Views under Vendor, then it all will be replaced whenever we do Composer Update.


RE: What is best practice to modify Vendor views? - iRedds - 01-06-2023

Views are defined in the config.
Or is this not what you need?


RE: What is best practice to modify Vendor views? - munggaran - 01-07-2023

(01-06-2023, 10:17 PM)iRedds Wrote: Views are defined in the config.
Or is this not what you need?

If I did modified all Config\* configuration, then if I do Composer Update then will the Config\* files remain or replaced?


RE: What is best practice to modify Vendor views? - datamweb - 01-07-2023

Hi @munggaran,

Command

Code:
php spark shield:setup

creates a new file for this topic in path app/Config/Auth.php.

Therefore, if you update with Composer, there will be no problem until you execute command

Code:
php spark shield:setup

again.

We have clearly explained this issue in the Manual Setup guide of the first(1) paragraph.

Refer to How to define custom views.

Meanwhile, I plan to add a CLI command to set the views via the command line to the shield in [email=https://github.com/codeigniter4/shield/pull/489]PR#489[/email], which has not been done yet.

So feel free to make your settings in file app/Config/Auth.php.


RE: What is best practice to modify Vendor views? - munggaran - 01-07-2023

(01-07-2023, 04:21 AM)datamweb Wrote: Hi @munggaran,

Command

Code:
php spark shield:setup

creates a new file for this topic in path app/Config/Auth.php.

Therefore, if you update with Composer, there will be no problem until you execute command

Code:
php spark shield:setup

again.

We have clearly explained this issue in the Manual Setup guide of the first(1) paragraph.

Refer to How to define custom views.

Meanwhile, I plan to add a CLI command to set the views via the command line to the shield in [email=https://github.com/codeigniter4/shield/pull/489]PR#489[/email], which has not been done yet.

So feel free to make your settings in file app/Config/Auth.php.

AHA!, this is what I'm looking for, need to get more intimate with manuals, thanksss