PHP code example of maiconpinto / cakephp-adminlte-theme

1. Go to this page and download the library: Download maiconpinto/cakephp-adminlte-theme library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maiconpinto / cakephp-adminlte-theme example snippets


// src/Application.php

public function bootstrap()
{
    $this->addPlugin('AdminLTE');
}

// src/Controller/AppController.php
use Cake\Event\EventInterface;

public function beforeRender(EventInterface  $event)
{
    $this->viewBuilder()->setTheme('AdminLTE');
}

// src/View/AppView.php

public function initialize()
{
    $this->loadHelper('Form', ['className' => 'AdminLTE.Form']);
}

// new config/adminlte.php file

return [
    'Theme' => [
        'title' => 'AdminLTE',
        'logo' => [
            'mini' => '<b>A</b>LT',
            'large' => '<b>Admin</b>LTE'
        ],
        'login' => [
            'show_remember' => true,
            'show_register' => true,
            'show_social' => true
        ],
        'folder' => ROOT,
        'skin' => 'blue'
    ]
];

// config/bootstrap.php

Configure::load('adminlte', 'default');

 echo $this->fetch('css'); 

 echo $this->Html->css('AdminLTE./bower_components/morris.js/morris', ['block' => 'css']); 

 echo $this->fetch('script'); 

 echo $this->Html->script('AdminLTE./bower_components/morris.js/morris.min', ['block' => 'script']); 

 echo $this->fetch('scriptBottom'); 

 $this->start('scriptBottom'); 

 echo $this->Flash->render();