https://github.com/luyadev/luya-bootstrap4
Bootstrap4 Assets and Helper classes like ActiveForm for LUYA and Yii2.
https://github.com/luyadev/luya-bootstrap4
bootstrap bootstrap4 hacktoberfest luya yii2
Last synced: 3 months ago
JSON representation
Bootstrap4 Assets and Helper classes like ActiveForm for LUYA and Yii2.
- Host: GitHub
- URL: https://github.com/luyadev/luya-bootstrap4
- Owner: luyadev
- License: mit
- Created: 2016-02-22T07:34:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T07:53:03.000Z (over 2 years ago)
- Last Synced: 2025-04-09T13:41:32.527Z (3 months ago)
- Topics: bootstrap, bootstrap4, hacktoberfest, luya, yii2
- Language: PHP
- Homepage: https://luya.io
- Size: 270 KB
- Stars: 18
- Watchers: 6
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
![]()
# Bootstrap 4
[](https://luya.io)

[](https://codeclimate.com/github/luyadev/luya-bootstrap4/test_coverage)
[](https://packagist.org/packages/luyadev/luya-bootstrap4)
[](https://packagist.org/packages/luyadev/luya-bootstrap4)
[](https://forum.luya.io/)Wrapper classes for new [Bootstrap 4](https://getbootstrap.com/) CSS Framework for [Yii](https://yiiframework.com) and/or [LUYA](https://luya.io).
> As of Bootstrap 4, the grid is completely written in FLEX. Check the [Browser Support](https://caniuse.com/#search=flex) to decide if you want to use Bootstrap 4 for your project.
This package contains the following components:
+ Widgets
+ ActiveForm Widget (Yii ActiveForm Widget matching the Bootstrap 4 form styles)
+ Breadcrumbs
+ LinkPager
+ ActiveField Widget
+ Grid View / Action Column
+ Tags
+ Tooltips
+ CMS Blocks
+ Image
+ Carousel
+ Asset File (contains precompiled bootstrap4 css and js files via cdn)## Installation
Add the package to your project via composer
```sh
composer require luyadev/luya-bootstrap4:^1.0
```## Assets Bundle
To use the css and js files of bootstrap just register the `Bootstrap4Asset` into your layout file with the following code of your layout.php file:
```php
luya\bootstrap4\Bootstrap4Asset::register($this)
```At the top section of your layout file. This will include all required css and js files to use bootstrap 4 and set the right depenecy with jquery.
## Active Form
A common way to build forms is the use thy Yii ActiveForm widget, to match all bootstrap4 components use it like following:
```php
Bootstrap 4 ActiveForm
= $form->field($model, 'username') ?>
= $form->field($model, 'password')->passwordInput() ?>
= Html::submitButton('Login', ['class' => 'btn btn-primary-outline']) ?>```
Tip: In order to style required fields with asterisks, you can use the following CSS:
```css
div.required label.control-label:after {
content: " *";
color: red;
}
```