PHPackages                             deanblackborough/bootstrap-4-helpers - 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. deanblackborough/bootstrap-4-helpers

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

deanblackborough/bootstrap-4-helpers
====================================

Standalone Bootstrap 4 view helpers to use outside of Zend Framework apps

v0.04(8y ago)132MITPHPPHP ^7

Since Nov 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/deanblackborough/bootstrap-4-helpers)[ Packagist](https://packagist.org/packages/deanblackborough/bootstrap-4-helpers)[ Docs](https://github.com/deanblackborough/bootstrap-4-helpers)[ RSS](/packages/deanblackborough-bootstrap-4-helpers/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (3)Versions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/becd211fb6255581cde4db78ceeccc1b3d82aa8020d91958b3548d8ff42c7ea4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465616e626c61636b626f726f7567682f626f6f7473747261702d342d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deanblackborough/bootstrap-4-helpers)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/deanblackborough/bootstrap-4-helpers/blob/master/LICENSE)[![Minimum PHP Version](https://camo.githubusercontent.com/5c3072425e67297c8ef63d17acd2c86a0d2ef324f19249f2280bd7de902f63a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e302d3838393242462e737667)](https://php.net/)[![Total Downloads](https://camo.githubusercontent.com/3f4a95512bdf957a86ee067d49c9c47c33b7fb0aea5a84a62ba69a89e39c1ead/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465616e626c61636b626f726f7567682f626f6f7473747261702d342d68656c706572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deanblackborough/bootstrap-4-helpers)

Bootstrap 4 helpers
===================

[](#bootstrap-4-helpers)

Bootstrap 4 component helpers

Description
-----------

[](#description)

Utility wrapper classes for the Bootstrap 4 view helpers in my ZF3-view-helpers library (), allows usage of the view helpers in any PHP site, not just Zend Framework apps.

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

[](#installation)

The easiest way to use the view helpers is via composer, `composer require deanblackborough/bootstrap-4-helpers`, alternatively include the classes in `src/` in your library.

Usage
-----

[](#usage)

Create a view helper is a two step process, you need to call the ViewHelper factory to create the relevant view helper and then you can chain the helpers methods to create your component.

```
$jumbotron = ViewHelper::jumbotron('Heading', 'Content');
echo $jumbotron->fluid()->setBgStyle('primary');

```

The view helpers
================

[](#the-view-helpers)

Alert
-----

[](#alert)

### Factory call

[](#factory-call)

```
$alert = ViewHelper::alert('Alert message');

```

### Methods, can be chained

[](#methods-can-be-chained)

- `setBgStyle(string $color)` - Set the background colour
- `setHeading(string $heading, int $heading_level)` - Set optional heading
- `setTextStyle(string $color)` - Set the text colour

Badge
-----

[](#badge)

### Factory call

[](#factory-call-1)

```
$badge = ViewHelper::badge('Label');

```

### Methods, can be chained

[](#methods-can-be-chained-1)

- `asLink()` - As link
- `pill()` - Display as pill
- `setBgStyle(string $color)` - Set the background colour
- `setTextStyle(string $color)` - Set the text colour

Button
------

[](#button)

### Factory call

[](#factory-call-2)

```
$button = ViewHelper::button('Label');

```

### Methods, can be chained

[](#methods-can-be-chained-2)

- `active()` - Active
- `block()` - Display as a full width block
- `customClass(string $class)` - Add a custom class
- `disabled()` - Set disabled
- `large()` - Large button
- `setBgStyle(string $color)` - Set the background colour
- `setModeButton()` - Render as a button
- `setModeInput()` - Render as an input
- `setOutlineStyle()` - Outline button
- `setUri(string $uri)` - Set URI
- `small()` - Small button

Column
------

[](#column)

### Factory call

[](#factory-call-3)

```
$column = ViewHelper::column('Content');

```

### Methods, can be chained

[](#methods-can-be-chained-3)

- `lg(int $size)` - Set lg column width
- `md(int $size)` - Set md column width
- `setBgStyle(string $color)` - Set the background colour
- `setTextStyle(string $color)` - Set the text colour
- `sm(int $size)` - Set sm column width
- `xl(int $size)` - Set xl column width
- `xs(int $size)` - Set xs column width

Jumbotron
---------

[](#jumbotron)

### Factory call

[](#factory-call-4)

```
$jumbotron = ViewHelper::jumbotron('Heading', 'Content');

```

### Methods, can be chained

[](#methods-can-be-chained-4)

- `fluid()` - Add fluid class
- `setBgStyle(string $color)` - Set the background colour
- `setHeadingDisplayLevel(int $level)` - Set the display level
- `setSubHeading(string $sub_heading)` - Set an optional sub heading
- `setTextStyle(string $color)` - Set the text colour

Progress bar
------------

[](#progress-bar)

### Factory call

[](#factory-call-5)

```
$progressBar = ViewHelper::progressBar(25);

```

### Methods, can be chained

[](#methods-can-be-chained-5)

- `animate()` - Animate
- `setBgStyle(string $color)` - Set the background colour
- `setHeight(int $height)` - Set height
- `setLabel(string $label)` - Set a label
- `setTextStyle(string $color)` - Set the text colour
- `striped()` - Striped background

Row
---

[](#row)

### Factory call

[](#factory-call-6)

```
$row = ViewHelper::row('');

```

### Methods, can be chained

[](#methods-can-be-chained-6)

- `setBgStyle(string $color)` - Set the background colour
- `setTextStyle(string $color)` - Set the text colour

No tests?
=========

[](#no-tests)

I'm not adding tests to this library, the tests for the functionality are within the  library, this library simply makes it possible to use the view helpers outside of the Zend Framework, I've not added any additional functionality.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

6

Last Release

3032d ago

PHP version history (2 changes)v0.01PHP ^7.1

v0.04PHP ^7

### Community

Maintainers

![](https://www.gravatar.com/avatar/4247123b3cdbe8640fd21f36d98d2244959eb901e43ed5f7c89f8ba954a5eda9?d=identicon)[deanblackborough](/maintainers/deanblackborough)

---

Top Contributors

[![deanblackborough](https://avatars.githubusercontent.com/u/7921914?v=4)](https://github.com/deanblackborough "deanblackborough (30 commits)")

---

Tags

helpercomponentbootstrapbootstrap 4

### Embed Badge

![Health badge](/badges/deanblackborough-bootstrap-4-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/deanblackborough-bootstrap-4-helpers/health.svg)](https://phpackages.com/packages/deanblackborough-bootstrap-4-helpers)
```

###  Alternatives

[laravelista/ekko

Framework agnostic PHP package for marking navigation items active.

278673.4k4](/packages/laravelista-ekko)[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

883.0M29](/packages/kartik-v-yii2-helpers)[kartik-v/yii2-field-range

Easily manage Yii 2 ActiveField ranges (from/to) with Bootstrap 3 addons markup and more

232.1M26](/packages/kartik-v-yii2-field-range)[codaxis/cakephp-bootstrap3-helpers

CakePHP highly configurable helpers for Bootstrap 3 framework.

4111.5k2](/packages/codaxis-cakephp-bootstrap3-helpers)[digitv/yii2bootstrap4

Yii2 Bootstrap 4 widgets

142.5k](/packages/digitv-yii2bootstrap4)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
