PHP code example of ahmedebead / cakephp-4-lte
1. Go to this page and download the library: Download ahmedebead/cakephp-4-lte 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' );
ahmedebead / cakephp-4-lte example snippets
public function bootstrap ()
{
$this ->addPlugin('CakephpLte' , ['autoload' => true , 'bootstrap' => true , 'routes' => true ]);
}
use Cake \Event \EventInterface ;
public function beforeRender (EventInterface $event)
{
$this ->viewBuilder()->setTheme('CakephpLte' );
$this ->viewBuilder()->setClassName('CakephpLte.CakephpLte' );
}
public function initialize ()
{
$this ->loadHelper('Form' , ['className' => 'CakephpLte.Form' ]);
$this ->loadHelper('Paginator' , ['templates' => 'CakephpLte.paginator-templates' ]);
}
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'
]
];
Configure::load('cakelte' , 'default' );
<!-- Bootstrap 4 rtl -->
echo $this ->Html->css('CakephpLte./css/bootstrap.rtl.min.css' );
<!-- Custom CSS rtl -->
echo $this ->Html->css('CakephpLte./css/rtl.css' );
<!-- 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();