PHPackages                             domprojects/codeigniter4-bootstrap - 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. domprojects/codeigniter4-bootstrap

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

domprojects/codeigniter4-bootstrap
==================================

Bootstrap 5 asset publisher for CodeIgniter 4 projects.

v1.1.1(2mo ago)012↓90.9%1MITPHPPHP ^8.2CI passing

Since Apr 2Pushed 2mo agoCompare

[ Source](https://github.com/domProjects/codeigniter4-bootstrap)[ Packagist](https://packagist.org/packages/domprojects/codeigniter4-bootstrap)[ Docs](https://github.com/domProjects/codeigniter4-bootstrap)[ RSS](/packages/domprojects-codeigniter4-bootstrap/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (1)

Bootstrap 5 for CodeIgniter 4
=============================

[](#bootstrap-5-for-codeigniter-4)

[![Packagist](https://camo.githubusercontent.com/7b66a70583546a43a0032cb684d737680207355fd5386b66f41b8ff90aca08b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d70726f6a656374732f636f646569676e69746572342d626f6f7473747261703f6c6162656c3d5061636b6167697374)](https://packagist.org/packages/domprojects/codeigniter4-bootstrap)[![License](https://camo.githubusercontent.com/6185d3084b0fa3ab7b14c754e2f0ce6fd9cbc76d95f2513f871cbe4c3c5a6ec2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f6d50726f6a656374732f636f646569676e69746572342d626f6f747374726170)](https://github.com/domProjects/codeigniter4-bootstrap/blob/main/LICENSE)[![PHPUnit](https://camo.githubusercontent.com/871a6f1e0525a0b1215e826365e2bb5e80c4852e2c863c9b3eeb407d7c5f3bf1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d50726f6a656374732f636f646569676e69746572342d626f6f7473747261702f706870756e69742e796d6c3f6272616e63683d6d61696e266c6162656c3d504850556e6974)](https://github.com/domProjects/codeigniter4-bootstrap/actions/workflows/phpunit.yml)[![Psalm](https://camo.githubusercontent.com/43d535de7bbe9e80a24cc566326337059ced668f516d266bfc4dea61eca28b6c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d50726f6a656374732f636f646569676e69746572342d626f6f7473747261702f7073616c6d2e796d6c3f6272616e63683d6d61696e266c6162656c3d5073616c6d)](https://github.com/domProjects/codeigniter4-bootstrap/actions/workflows/psalm.yml)[![PHPStan](https://camo.githubusercontent.com/84e23d15664cb7d36a86840c801325327fc928482f532f309e231fc5ea7ad3a4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d50726f6a656374732f636f646569676e69746572342d626f6f7473747261702f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d5048505374616e)](https://github.com/domProjects/codeigniter4-bootstrap/actions/workflows/phpstan.yml)

Bootstrap 5 tools for CodeIgniter 4.

This package currently provides:

- a Spark command that publishes the Bootstrap distribution files from Composer dependencies into your public directory
- reusable CodeIgniter 4 Cells for Bootstrap components
- CI4 helpers for validation-aware form payloads and table payload generation

Features
--------

[](#features)

- Installs Bootstrap with Composer
- Publishes only the Bootstrap production assets
- Provides reusable Bootstrap component Cells for CodeIgniter 4 views
- Includes helper functions for forms, validation, and tables
- Works with CodeIgniter 4 auto-discovery
- Keeps Bootstrap asset publication explicit and framework-oriented

Requirements
------------

[](#requirements)

- PHP 8.2 or newer
- CodeIgniter 4.7.2 or newer
- Bootstrap 5.3.8 or newer within the 5.3 branch

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

[](#installation)

Install the package in your CodeIgniter 4 project:

```
composer require domprojects/codeigniter4-bootstrap
```

Optional Automation Plugin
--------------------------

[](#optional-automation-plugin)

If you also want automatic publication after `composer install` and `composer update`, install the companion plugin:

```
composer require domprojects/codeigniter4-bootstrap-plugin
```

The plugin package is optional. This main package works on its own.

Spark Command
-------------

[](#spark-command)

Publish assets manually:

```
php spark assets:publish-bootstrap
```

Force overwrite existing files:

```
php spark assets:publish-bootstrap --force
```

Published Files
---------------

[](#published-files)

The package publishes these files:

- `css/bootstrap.min.css`
- `css/bootstrap.min.css.map`
- `js/bootstrap.bundle.min.js`
- `js/bootstrap.bundle.min.js.map`

Destination
-----------

[](#destination)

Files are published to:

```
public/assets/bootstrap

```

Usage in Views
--------------

[](#usage-in-views)

Example in a CodeIgniter view:

```
