fm-labs / cakephp-bootstrap
Twitter Bootstrap plugin for CakePHP
Installs: 152
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=7.2
- cakephp/cakephp: ^4.0
README
Twitter Bootstrap for CakePHP
Installation
composer require fm-labs/cakephp-bootstrap
Version Info
Usage
First, load and enable the plugin.
// In Application' bootstrap method, add: $this->addPlugin('Bootstrap')
Use the \Bootstrap\View\Helper\BootstrapHelper
to load bootstrap assets:
In templates
// E.g. at the top of your (layout) template file: $this->loadHelper('Bootstrap.Bootstrap'); // bootstrap 5.x (via CDN) //$this->loadHelper('Bootstrap.Bootstrap4'); // bootstrap 4.x (via CDN) //$this->loadHelper('Bootstrap.Bootstrap3'); // bootstrap 3.x (from plugin webroot)
Application-wide
// E.g. in your AppController class AppController extends \Cake\Controller\Controller { public function initialize(){ //... $this->viewBuilder()->loadHelper('Bootstrap.Bootstrap') } }