Skip to content

Commit 59a676f

Browse files
committed
Init documentation about release 1.0.6
1 parent e578282 commit 59a676f

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function initialize()
3939
}
4040
```
4141

42-
### Configure
42+
### ~Configure~ (deprecated in 1.0.6)
4343

4444
```php
4545
// src/Controller/AppController.php
@@ -66,11 +66,12 @@ Configure::write('Theme', [
6666
'show_register' => true,
6767
'show_social' => true
6868
],
69-
'folder' => ROOT
69+
'folder' => ROOT,
70+
'skin' => 'blue' // default is 'blue'
7071
]);
7172
```
7273

73-
### Customize Layout
74+
### ~Customize Layout~ (deprecated in 1.0.6)
7475

7576
Replace the files according to the image.
7677

@@ -86,6 +87,38 @@ Replace the files according to the image.
8687

8788
Remember to remove the initial PHP block and the final closing brace when copying the desired template element to customize.
8889

90+
### Customize Layout (from 1.0.6)
91+
92+
```php
93+
// src/Controller/AppController.php
94+
use Cake\Core\Configure;
95+
96+
public function beforeRender(Event $event)
97+
{
98+
// ...
99+
$this->viewBuilder()->className('AdminLTE.AdminLTE');
100+
}
101+
```
102+
103+
After you enable the AdminLTEView class in the AppController.php file, you can overwrite any View file, only by creating the Plugin / AdminLTE / folder inside the Template folder.
104+
105+
For example, to overwrite the elements files, you must create them as follows:
106+
107+
1. `src/Template/Plugin/AdminLTE/Element/nav-top.ctp`
108+
2. `src/Template/Plugin/AdminLTE/Element/aside-main-sidebar.ctp`
109+
3. `src/Template/Plugin/AdminLTE/Element/aside/user-panel.ctp`
110+
4. `src/Template/Plugin/AdminLTE/Element/aside/form.ctp`
111+
5. `src/Template/Plugin/AdminLTE/Element/aside/sidebar-menu.ctp`
112+
6. `src/Template/Plugin/AdminLTE/Element/aside-control-sidebar.ctp`
113+
7. `src/Template/Plugin/AdminLTE/Element/footer.ctp`
114+
115+
The biggest news is that you can override elements also for prefixes. This means that you can have a footer element, for an environment that has an Admin prefix, and a different footer element for the environment that has no prefix.
116+
117+
For example:
118+
119+
1. `src/Template/Plugin/AdminLTE/Element/footer.ctp`
120+
1. `src/Template/Plugin/AdminLTE/Admin/Element/footer.ctp`
121+
89122
### Page debug
90123

91124
Added link to default page of CakePHP.

0 commit comments

Comments
 (0)