PHP code example of elboletaire / twbs-cake-plugin

1. Go to this page and download the library: Download elboletaire/twbs-cake-plugin 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/ */

    

elboletaire / twbs-cake-plugin example snippets


Plugin::load('Bootstrap', ['bootstrap' => true]);

Plugin::load('Bootstrap');
Plugin::load('Less');
Plugin::load('BootstrapUI');

// AppController.php
public $helpers = [
    'Less.Less', // apUI.Flash',
    'BootstrapUI.Paginator'
];

// AppView.php
public function initialize()
{
    $this->loadHelper('Less', ['className' => 'Less.Less']);
    $this->loadHelper('Html', ['className' => 'BootstrapUI.Html']);
    $this->loadHelper('Form', ['className' => 'BootstrapUI.Form']);
    $this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash']);
    $this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']);
}

// any .ctp Template file
$this->layout = 'Bootstrap.default';

echo $this->Less->less('less/styles.less');

$this->Flash->{whatever}("Hello World", ['params' => ['class' => ['alert']]]);

// where {whatever} is any of the Bootstrap alert classes (danger, info, warning...)
$this->Flash->success("Hello World", ['params' => ['class' => ['alert']]]);