https://github.com/deanblackborough/bootstrap-4-helpers
Standalone Bootstrap 4 view helpers to use outside of Zend Framework apps
https://github.com/deanblackborough/bootstrap-4-helpers
Last synced: 2 months ago
JSON representation
Standalone Bootstrap 4 view helpers to use outside of Zend Framework apps
- Host: GitHub
- URL: https://github.com/deanblackborough/bootstrap-4-helpers
- Owner: deanblackborough
- License: mit
- Created: 2017-10-31T23:28:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-21T16:37:25.000Z (over 7 years ago)
- Last Synced: 2025-01-30T04:26:43.124Z (4 months ago)
- Language: PHP
- Size: 29.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/deanblackborough/bootstrap-4-helpers)
[](https://github.com/deanblackborough/bootstrap-4-helpers/blob/master/LICENSE)
[](https://php.net/)
[](https://packagist.org/packages/deanblackborough/bootstrap-4-helpers)# Bootstrap 4 helpers
Bootstrap 4 component helpers
## Description
Utility wrapper classes for the Bootstrap 4 view helpers in my ZF3-view-helpers library
(https://github.com/deanblackborough/zf3-view-helpers), allows usage of the view helpers in any PHP site,
not just Zend Framework apps.## 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
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
## Alert
### Factory call
```
$alert = ViewHelper::alert('Alert message');
```### 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
### Factory call
```
$badge = ViewHelper::badge('Label');
```### Methods, can be chained
* ```asLink()``` - As link
* ```pill()``` - Display as pill
* ```setBgStyle(string $color)``` - Set the background colour
* ```setTextStyle(string $color)``` - Set the text colour## Button
### Factory call
```
$button = ViewHelper::button('Label');
```### Methods, can be chained
* ```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
### Factory call
```
$column = ViewHelper::column('Content
');
```### Methods, can be chained
* ```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
### Factory call
```
$jumbotron = ViewHelper::jumbotron('Heading', 'Content
');
```### Methods, can be chained
* ```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
### Factory call
```
$progressBar = ViewHelper::progressBar(25);
```### Methods, can be chained
* ```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
### Factory call
```
');
$row = ViewHelper::row('
```### Methods, can be chained
* ```setBgStyle(string $color)``` - Set the background colour
* ```setTextStyle(string $color)``` - Set the text colour# No tests?
I'm not adding tests to this library, the tests for the functionality are within the
https://github.com/deanblackborough/zf3-view-helpers library, this library simply makes it possible to use
the view helpers outside of the Zend Framework, I've not added any additional functionality.