PHPackages                             arthusantiago/bootstrap-for-cakephp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. arthusantiago/bootstrap-for-cakephp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

arthusantiago/bootstrap-for-cakephp
===================================

Automatically copy Bootstrap and Bootstrap Icons assets to CakePHP webroot directory

v1.2.0(4mo ago)057MITPHPPHP &gt;=8.1

Since Oct 31Pushed 4mo agoCompare

[ Source](https://github.com/arthusantiago/bootstrap-for-cakephp)[ Packagist](https://packagist.org/packages/arthusantiago/bootstrap-for-cakephp)[ Docs](https://github.com/arthusantiago/bootstrap-for-cakephp)[ RSS](/packages/arthusantiago-bootstrap-for-cakephp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Bootstrap for CakePHP
=====================

[](#bootstrap-for-cakephp)

[![Packagist](https://camo.githubusercontent.com/1b56332be46b2bd17dc788e50ced2e9a4cb8ae1a2eea26d4780d7c602f88b551/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617274687573616e746961676f2f626f6f7473747261702d666f722d63616b657068702e737667)](https://packagist.org/packages/arthusantiago/bootstrap-for-cakephp)[![PHP Version](https://camo.githubusercontent.com/811d2b1c4a3a4357130036a97903bf7bed5b93c40d17da5ba099fd21f5e4b47d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617274687573616e746961676f2f626f6f7473747261702d666f722d63616b65706870)](https://packagist.org/packages/arthusantiago/bootstrap-for-cakephp)[![License](https://camo.githubusercontent.com/22e32946fddd24d636d4bf0e9258ec01668eae3cf3acf9e6e75a19b073cfe3ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f617274687573616e746961676f2f626f6f7473747261702d666f722d63616b657068702e737667)](LICENSE)

Automatically copy [Bootstrap](https://getbootstrap.com/) and [Bootstrap Icons](https://icons.getbootstrap.com/) assets to your CakePHP `webroot/` directory when packages are installed or updated via Composer.

Features
--------

[](#features)

- ✨ Automatic copying of Bootstrap CSS and JS files
- ✨ Automatic copying of Bootstrap Icons CSS and fonts
- 🚀 Works with Composer package install/update hooks
- 🛠️ Manual CLI command for on-demand copying
- ✅ Fully compatible with CakePHP 4.x and 5.x
- 🔧 Customizable configuration and paths
- 📝 Comprehensive logging via Composer IO interface

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require arthusantiago/bootstrap-for-cakephp
```

Then ensure you have Bootstrap installed:

```
composer require twbs/bootstrap twbs/bootstrap-icons
```

How It Works
------------

[](#how-it-works)

This package automatically detects when Bootstrap or Bootstrap Icons are installed or updated via Composer, and copies the necessary files to your CakePHP `webroot/` directory:

- **Bootstrap CSS/JS** → `webroot/css/` and `webroot/js/`
- **Bootstrap Icons** → `webroot/css/` and `webroot/css/fonts/`

Usage
-----

[](#usage)

### Automatic (Recommended)

[](#automatic-recommended)

Once installed, the package automatically copies assets whenever you:

```
composer install
composer update
composer require twbs/bootstrap
composer update twbs/bootstrap
```

### Manual Copy

[](#manual-copy)

If you need to manually copy assets, use the CLI command:

```
# Copy all supported packages automatically
composer copy-bootstrap-assets

# Or copy specific package assets
composer copy-bootstrap-assets twbs/bootstrap twbs/bootstrap-icons

# Or copy each one individually
composer copy-bootstrap-assets twbs/bootstrap
composer copy-bootstrap-assets twbs/bootstrap-icons
```

Advanced Usage
--------------

[](#advanced-usage)

### Customizing Asset Paths

[](#customizing-asset-paths)

Extend the `AssetsConfig` class to customize where assets are copied:

```
