A PHP library that prints html for bootstrap
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src
LICENSE
README.md
composer.json

README.md

Bootstrap PHP

A highly extendable PHP library that generate and prints html for bootstrap.

Installation

$ composer require lodev09/bootstrap-php

Built-in Components

The library has built-in components that are already available for you to use. See creating custom components to learn more on how to create your own component.

If you want me to add your own component, feel free to contribute and submit a PR!

Usage

// register the component(s) you want to use
\Bootstrap\Component::register('table', 'Bootstrap\Components\Table');

// create the comonent ui instance (this can be used globally)
$ui = new \Bootstrap\Component();

// somewhere in your project.
// sample data from your db
$data = [
    ['name' => 'Jovanni Lo', 'email' => 'lodev09@gmail.com'],
    ['name' => 'foo', 'email' => 'bar@email.com']
];

$table = $ui->create_table($data);
$table->cell = [
    'name' => [
        'class' => 'text-primary',
        'url' => '#docs',
        // ... so much more
    ],
    // can also be a closure
    'username' => function($row, $index, $value) {
        // print_r($row)
        return '<strong>@'.$row['username'].'</strong>';
    }
];

// print the html
$table->print_html();

Feedback

All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at www.lodev09.com or email me at lodev09@gmail.com

Credits

© 2018 - Coded by Jovanni Lo / @lodev09

License

Released under the MIT License. See LICENSE file.