No description
Find a file
2025-12-15 21:29:59 +01:00
.github Bump actions/cache from 4 to 5 2025-12-15 02:23:40 +00:00
.vscode OffCanvas class added 2025-03-10 20:30:06 +01:00
debian Update debian/Jenkinsfile to latest version from DebianRepository 2025-10-17 22:16:24 +02:00
docs Fix Tabs - prepend container ID to tab pane IDs to avoid conflicts 2025-10-24 02:07:47 +02:00
Examples Updates examples and dependencies; improves panel logic 2025-06-05 16:23:03 +02:00
nbproject v1.0.0 release 2024-11-18 04:11:59 +01:00
src/Ease/TWB5 Load AJAX content for initially active tabs on page load 2025-10-24 14:27:04 +02:00
tests OffCanvas class added 2025-03-10 20:30:06 +01:00
.gitignore Updates dependencies and versioning for release 1.2.0 2025-06-05 17:31:39 +02:00
.php-cs-fixer.dist.php v0.1.0 release 2024-10-06 23:38:08 +02:00
composer.json composer: update friendsofphp/php-cs-fixer requirement 2025-12-15 20:28:47 +00:00
LICENSE Initial commit 2021-03-26 00:10:48 +01:00
Makefile v0.1.0 release 2024-10-06 23:38:08 +02:00
phpstan-default-baseline.neon v0.1.0 release 2024-10-06 23:38:08 +02:00
phpstan-default.neon.dist v0.1.0 release 2024-10-06 23:38:08 +02:00
phpunit.xml Initial PHPunit #3 2022-12-31 00:54:05 +01:00
project-logo.png Initial minimal functionality 2022-05-27 18:11:09 +02:00
project-logo.svg Initial minimal functionality 2022-05-27 18:11:09 +02:00
README.md v0.1.0 release 2024-10-06 23:38:08 +02:00
WARP.md Fix Tabs - prepend container ID to tab pane IDs to avoid conflicts 2025-10-24 02:07:47 +02:00

php-ease-twbootstrap5

TwitterBootstrap5 classes for EasePHP Framework

Note

: If you are looking for a similar PHP library for Bootstrap 4, you can find it at php-ease-twbootstrap4.

Overview

This initial release includes a set of PHP classes designed to facilitate the creation of web components using Twitter Bootstrap 5. Each class corresponds to a specific Bootstrap component, providing an easy-to-use interface for integrating these components into your web applications.

Classes and Their Functionalities

Alert.php

  • Functionality: Create and manage Bootstrap alert messages.
  • Features: Supports different alert types (success, danger, warning, info), dismissible alerts, and custom messages.
use Ease\TwBootstrap5\Alert;

$alert = new Alert('This is a success alert!', 'success');
echo $alert->draw();

Badge.php

  • Functionality: Generate Bootstrap badges.
  • Features: Supports different badge styles and contextual colors.
use Ease\TwBootstrap5\Badge;

$badge = new Badge('New', 'primary');
echo $badge->draw();

Card.php

  • Functionality: Create Bootstrap card components.
  • Features: Supports card headers, footers, images, and various content types.
use Ease\TwBootstrap5\Card;

$card = new Card('Card Title', 'This is some text within a card body.');
echo $card->draw();

Col.php

  • Functionality: Define column layouts using Bootstrap's grid system.
  • Features: Supports different column sizes and responsive breakpoints.

Container.php

  • Functionality: Create Bootstrap container elements.
  • Features: Supports fluid and fixed-width containers.
use Ease\TwBootstrap5\Container;

$container = new Container('This is a container.');
echo $container->draw();

Form.php

  • Functionality: Generate Bootstrap forms.
  • Features: Supports various form controls, validation states, and layout options.
use Ease\TwBootstrap5\Form;

$form = new Form('POST', '/submit');
$form->addItem(new Input('text', 'username', 'Username'));
echo $form->draw();

FormGroup.php

  • Functionality: Group form controls with labels and help text.
  • Features: Supports different form group layouts and validation states.

InputGroup.php

  • Functionality: Create input groups with prepend and append elements.
  • Features: Supports various input types and custom elements.

LinkButton.php

  • Functionality: Generate Bootstrap-styled link buttons.
  • Features: Supports different button styles and sizes.
use Ease\TwBootstrap5\LinkButton;

$linkButton = new LinkButton('Click Me', 'https://example.com', 'primary');
echo $linkButton->draw();

NavItemDropDown.php

  • Functionality: Create dropdown items for navigation bars.
  • Features: Supports nested dropdowns and various alignment options.
use Ease\TwBootstrap5\NavItemDropDown;

$dropdown = new NavItemDropDown('Dropdown', [
    'Action' => '#action',
    'Another action' => '#another-action',
    'Something else here' => '#something-else'
]);
echo $dropdown->draw();

Navbar.php

  • Functionality: Generate Bootstrap navigation bars.
  • Features: Supports different navbar styles, responsive behaviors, and brand elements.
use Ease\TwBootstrap5\Navbar;

$navbar = new Navbar('My Website', [
    'Home' => '#home',
    'About' => '#about',
    'Contact' => '#contact'
]);
echo $navbar->draw();

Panel.php

  • Functionality: Create Bootstrap panels.
  • Features: Supports panel headers, footers, and various content types.

Part.php

  • Functionality: Base class for reusable component parts.
  • Features: Provides common functionality for other components.

Row.php

  • Functionality: Define row layouts using Bootstrap's grid system.
  • Features: Supports different row configurations and responsive breakpoints.
use Ease\TwBootstrap5\Row;

$row = new Row([
    new Col('Column 1', 6),
    new Col('Column 2', 6)
]);
echo $row->draw();

SubmitButton.php

  • Functionality: Generate Bootstrap-styled submit buttons.
  • Features: Supports different button styles and sizes.
use Ease\TwBootstrap5\SubmitButton;

$submitButton = new SubmitButton('Submit', 'primary');
echo $submitButton->draw();

Table.php

  • Functionality: Create Bootstrap-styled tables.
  • Features: Supports striped, bordered, hoverable, and responsive tables.
use Ease\TwBootstrap5\Table;

$table = new Table([
    ['Header 1', 'Header 2'],
    ['Row 1 Col 1', 'Row 1 Col 2'],
    ['Row 2 Col 1', 'Row 2 Col 2']
]);
echo $table->draw();

Tabs.php

  • Functionality: Generate Bootstrap tab components.
  • Features: Supports different tab styles and dynamic content loading.

WebPage.php

  • Functionality: Base class for creating web pages with Bootstrap components.
  • Features: Provides common functionality for integrating various Bootstrap components into a web page.
use Ease\TwBootstrap5\WebPage;

$page = new WebPage('My Web Page');
$page->addItem(new Container('This is the main content.'));
echo $page->draw();

Conclusion

This release provides a comprehensive set of tools for integrating Bootstrap 5 components into your PHP applications, making it easier to create responsive and visually appealing web interfaces.

Installation

To install the library, you can use Composer. Run the following command in your project directory:

composer require vitexsoftware/php-ease-twbootstrap5

Alternatively, you can add the library to your composer.json file manually:

{
    "require": {
        "vitexsoftware/php-ease-twbootstrap5": "^0.1"
    }
}

Then, run:

composer install

After installation, you can include the autoload file in your PHP scripts to start using the library:

require 'vendor/autoload.php';

You are now ready to use the TwitterBootstrap5 classes in your EasePHP Framework projects.