brammo / bootstrap-ui
Bootstrap helpers for CakePHP
Requires
- php: >=8.2
- cakephp/cakephp: ^5.3
- friendsofcake/bootstrap-ui: ^5.1
Requires (Dev)
- cakephp/cakephp-codesniffer: ^5.3
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5
- vimeo/psalm: ^5.26
This package is auto-updated.
Last update: 2026-06-18 04:19:59 UTC
README
A CakePHP plugin that extends FriendsOfCake/bootstrap-ui with additional Bootstrap 5 view helpers for building responsive UI components.
Requirements
- PHP 8.1+
- CakePHP 5.3+
- FriendsOfCake/bootstrap-ui 5.1+ (for
NavHelpericons and URL building viaBootstrapUI.Html)
Installation
You can install this plugin using Composer:
composer require brammo/bootstrap-ui
Load the Plugin
Add the following to your Application.php:
public function bootstrap(): void { parent::bootstrap(); $this->addPlugin('Brammo/BootstrapUI'); }
Or load via command line:
bin/cake plugin load Brammo/BootstrapUI
Usage
Load the helpers in your AppView.php:
public function initialize(): void { parent::initialize(); // Load individual helpers $this->loadHelper('Brammo/BootstrapUI.Card'); $this->loadHelper('Brammo/BootstrapUI.Table'); $this->loadHelper('Brammo/BootstrapUI.Description'); $this->loadHelper('Brammo/BootstrapUI.Nav'); $this->loadHelper('Brammo/BootstrapUI.Carousel'); }
NavHelper uses FriendsOfCake’s BootstrapUI.Html helper (icons, array URLs). Load that helper in AppView if it is not already available from your bootstrap-ui setup.
View Helpers
The plugin provides several view helpers. All helpers use CakePHP's StringTemplateTrait for flexible template customization.
| Helper | Description | Documentation |
|---|---|---|
CardHelper |
Bootstrap cards with optional header and footer | docs/card.md |
TableHelper |
Responsive HTML tables with headers and rows | docs/table.md |
DescriptionHelper |
Description lists (<dl>) for key-value pairs |
docs/description.md |
NavHelper |
Nav tabs/pills with tab panels or links | docs/nav.md |
CarouselHelper |
Carousels with controls, indicators, and captions | docs/carousel.md |
See docs/template-customization.md for customizing helper templates at runtime or via configuration.
Tests
Run the test suite with PHPUnit:
composer test
Code Quality
Run code style checks:
composer cs-check
Fix code style issues:
composer cs-fix
Static Analysis
Run PHPStan and Psalm:
composer analyse
Or run them individually:
composer stan composer psalm
License
This plugin is licensed under the MIT License.
Author
Roman Sidorkin - roman.sidorkin@gmail.com