PHP code example of ahmedebead / cakelte

1. Go to this page and download the library: Download ahmedebead/cakelte 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/ */

    

ahmedebead / cakelte example snippets


// src/Application.php

public function bootstrap()
{
    $this->addPlugin('CakephpLte', ['autoload' => true, 'bootstrap' => true, 'routes' => true]);
}

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

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

// src/View/AppView.php

public function initialize()
{
    $this->loadHelper('Form', ['className' => 'CakephpLte.Form']);
    $this->loadHelper('Paginator', ['templates' => 'CakephpLte.paginator-templates']);

}

// new config/cakephplte.php file

return [
    'CakephpLteTheme' => [
        'title' => 'CakephpLte',
        'logo' => [
            'mini' => '<b>AE</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('cakelte', 'default');

// Css
     <!-- Bootstrap 4 rtl -->
     echo $this->Html->css('CakephpLte./css/bootstrap.rtl.min.css'); 
     <!-- Custom CSS rtl -->
     echo $this->Html->css('CakephpLte./css/rtl.css'); 

// JS
     <!-- Bootstrap 4 rtl -->
     echo $this->Html->script('CakephpLte./js/bootstrap.rtl.min.js'); 


$this->layout = 'CakephpLte.rtl';


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

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

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

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

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

 $this->start('scriptBottom'); 

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