PHP code example of vitexsoftware / ease-twbootstrap5
1. Go to this page and download the library: Download vitexsoftware/ease-twbootstrap5 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vitexsoftware / ease-twbootstrap5 example snippets
use Ease\TWB5\Accordion;
$accordion = new Accordion('faq', [
'What is Bootstrap?' => 'A CSS framework.',
'What is EasePHP?' => 'A PHP rendering library.',
]);
$accordion->addAccordionItem('Custom item', 'Added programmatically.', true);
echo $accordion->draw();
use Ease\TWB5\Alert;
$alert = new Alert('success', 'Operation completed successfully!');
echo $alert->draw();
use Ease\TWB5\Badge;
$badge = new Badge('New', 'primary');
echo $badge->draw();
use Ease\TWB5\Breadcrumb;
$breadcrumb = new Breadcrumb([
'Home' => '/',
'Library' => '/library',
'Data' => '',
]);
echo $breadcrumb->draw();
use Ease\TWB5\ButtonGroup;
use Ease\Html\ButtonTag;
$group = new ButtonGroup([
new ButtonTag('Left', ['class' => 'btn btn-primary']),
new ButtonTag('Middle', ['class' => 'btn btn-primary']),
new ButtonTag('Right', ['class' => 'btn btn-primary']),
], '', false, 'Toolbar');
echo $group->draw();
use Ease\TWB5\Card;
$card = new Card('This is the card body content.');
echo $card->draw();
use Ease\TWB5\Collapse;
$collapse = new Collapse('details', 'Hidden content revealed on click.');
echo $collapse->triggerButton('Show details')->draw();
echo $collapse->draw();
use Ease\TWB5\Container;
$container = new Container('This is a container.');
echo $container->draw();
use Ease\TWB5\Form;
use Ease\Html\InputTextTag;
$form = new Form(['method' => 'POST', 'action' => '/submit']);
$form->addInput(new InputTextTag('username'), 'Username');
echo $form->draw();
use Ease\TWB5\LinkButton;
$linkButton = new LinkButton('https://example.com', 'Click Me', 'primary');
echo $linkButton->draw();
use Ease\TWB5\ListGroup;
$list = new ListGroup([
'Settings' => '/settings',
'Profile' => '/profile',
]);
$list->addListItem('Notifications', 'warning');
echo $list->draw();
use Ease\TWB5\Modal;
$modal = new Modal('confirmDelete', 'Confirm', 'Are you sure?', 'This cannot be undone.');
echo $modal->triggerButton('Delete', 'danger')->draw();
echo $modal->draw();
use Ease\TWB5\Nav;
$nav = new Nav([
'Home' => '/',
'About' => '/about',
'Contact' => '/contact',
], 'tabs');
echo $nav->draw();
use Ease\TWB5\Navbar;
$navbar = new Navbar('My Website', [
'Home' => '#home',
'About' => '#about',
]);
echo $navbar->draw();
use Ease\TWB5\OffCanvas;
$offcanvas = new OffCanvas('sidebar', 'Slide-in Menu', 'Panel body content here.');
echo $offcanvas->draw();
use Ease\TWB5\Pagination;
$pagination = new Pagination(3, 10, '?page=%d');
echo $pagination->draw();
use Ease\TWB5\Panel;
$panel = new Panel('Panel Heading', 'success', 'Panel body content.', 'Panel footer');
$panel->addItem('More body content');
echo $panel->draw();
use Ease\TWB5\Progress;
$progress = new Progress(65, 0, 100, 'success');
echo $progress->draw();
// Striped and animated
$progress = new Progress(40, 0, 100, 'warning', true, true, '40%');
echo $progress->draw();
use Ease\TWB5\Row;
use Ease\TWB5\Col;
$row = new Row([
new Col(6, 'Left column'),
new Col(6, 'Right column'),
]);
echo $row->draw();
use Ease\TWB5\Spinner;
echo (new Spinner())->draw(); // default border, primary
echo (new Spinner('grow', 'success', 'sm'))->draw(); // small growing dot, green
use Ease\TWB5\SubmitButton;
$submit = new SubmitButton('Save changes', 'primary');
echo $submit->draw();
use Ease\TWB5\Table;
$table = new Table([
['Name', 'Score'],
['Alice', '95'],
['Bob', '87'],
]);
echo $table->draw();
use Ease\TWB5\Tabs;
$tabs = new Tabs();
$tabs->addTab('Overview', 'Overview content here.', true);
$tabs->addTab('Details', 'Details content here.');
$tabs->addAjaxTab('Live', '/api/live-data');
echo $tabs->draw();
use Ease\TWB5\Toast;
$toast = new Toast('Notification', 'Your file was saved.', 'Just now');
echo $toast->draw();
// Persistent (no auto-hide)
$toast = new Toast('Warning', 'Action
use Ease\TWB5\WebPage;
use Ease\TWB5\Container;
$page = new WebPage('My Web Page');
$page->addItem(new Container('Main content goes here.'));
echo $page->draw();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.