technicalguru/bootstrap

Provide Bootstrap to PHP apps

v1.0.0 2020-11-13 17:38 UTC

This package is auto-updated.

Last update: 2024-03-29 04:32:51 UTC


README

Provides Bootstrap links for PHP apps using the twbs/bootstrap module.

License

This project is licensed under GNU LGPL 3.0.

Installation

By Composer

composer install technicalguru/bootstrap

By Package Download

You can download the source code packages from GitHub Release Page

How to use

Get the provided version number

$version = \TgBootstrap\Bootstrap::getVersion();

Get the URI of Bootstrap CSS stylesheet and JavaScript library

The following methods will give you URIs for your further inspection:

use TgBootstrap\Bootstrap;

// Get URI to all minified CSS
$uri = Bootstrap::getCssUri();

// Get URI to all uncompressed grid module CSS
$uri = Bootstrap::getCssUri('grid', FALSE);

// Get URI to minified Javascript bundle
$uri = Bootstrap::getJsUri();

// Get URI to minified, normal Bootstrap Javascript
$uri = Bootstrap::getJsUri(FALSE);

// Get URI to uncompressed, normal Bootstrap Javascript
$uri = Bootstrap::getJsUri(FALSE, FALSE);

You can get the correct HTML tags to be included in your HTML output in the same way:

use TgBootstrap\Bootstrap;

// Get HTML stylesheet tag to all minified CSS
$tag = Bootstrap::getCssLink();

// Get HTML stylesheet tag to all uncompressed grid module CSS
$tag = Bootstrap::getCssLink('grid', FALSE);

// Get HTML Javascript tag to minified Javascript bundle
$tag = Bootstrap::getJsLink();

// Get HTML Javascript tag to minified, normal Bootstrap Javascript
$tag = Bootstrap::getJsLink(FALSE);

// Get HTML Javascript tag to uncompressed, normal Bootstrap Javascript
$tag = Bootstrap::getJsLink(FALSE, FALSE);

All methods will throw an BootstrapException when you ask for a non-existing library.

Contribution

Report a bug, request an enhancement or pull request at the GitHub Issue Tracker.