arodu / cakelte

AdminLTE plugin for CakePHP
https://packagist.org/packages/arodu/cakelte
MIT License
28 stars 6 forks source link

Unable to overwrite layout files (v1.1.1 / cakephp4.5.2) #73

Closed katouam closed 7 months ago

katouam commented 7 months ago

Thanks for this wonderful AdminLTE plugin.

I was able to overwrite correctly the folders under the "templates/element/" dir. But The Layout files ( "templates/layout/" ) were not able to overwrite.

Layouts

Do I need any settings? I use trait into src/View/AppView.php (Recomended)

My environment.

overwrite

katouam commented 7 months ago

I found a solution. But I don't know this is the correct way to do it...

I referred to the following method. https://book.cakephp.org/4/en/plugins.html#plugin-templates

  1. Create a plugin/CakeLte directory {myproject}/templates/plugin/CakeLte/layout

  2. Place layout files. {myproject}/templates/plugin/CakeLte/layout/default.php

By the way, I tried moving elements under the plugin directory,

example {myproject}/templates/plugin/CakeLte/element/header/main.php {myproject}/templates/plugin/CakeLte/element/header/menu.php {myproject}/templates/plugin/CakeLte/element/content/header.php

These were overwritten.

If anyone knows, please comment if this method is correct.

over2

arodu commented 7 months ago

I found a solution. But I don't know this is the correct way to do it...

Yes.. that is the correct way to do it...