strappin-php / engine
PHP classes that make creating Bootstrap markup easier and cleaner
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^7.4|^8.1.3
Requires (Dev)
- danbettles/codesniffer-standard: ^2.0
- danbettles/marigold: ^4.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-04-05 09:52:01 UTC
README
Bootstrap is super awesome for quickly building easy-to-use—and easy-on-the-eyes—Web interfaces, but things can quickly become very, very fiddly. We really appreciate the Bootstrap team's consideration of accessibility and semantics, but that necessarily comes with a lot of words and a lot of wiring.
Strappin' is a growing collection of PHP classes, and—crucially—a factory, that makes creating Bootstrap markup quicker and easier. Its power is in joining things up so you can stop worrying about IDs, roles, and aria-this
~aria-that
.
This library can be easily integrated with templating engines such as Twig.
Example
Strappin' is still being moulded into the right shape—so we aren't ready to fully document everything yet—but here's an example of how you can currently use the library to create a tabbed interface:
use StrappinPhp\Engine\Factory; echo Factory::create()->createTabbedInterface([ 'panels' => [ [ 'action' => 'bs:toggle?object=tab&target=tab-pane-optimal-1', 'label' => 'Tab-Pane 1 Label', 'content' => 'Tab-pane 1 content.', ], [ 'action' => 'bs:toggle?object=tab&target=tab-pane-optimal-2', 'label' => 'Tab-Pane 2 Label', 'content' => 'Tab-pane 2 content.', ], [ 'action' => 'https://example.com/', 'label' => 'External Link', ], ], ]);
ℹ️ We use a custom URL format to easily express Bootstrap actions
Live Demo
For now:
- Clone this repo
- Run
composer install
at the root of the clone - Navigate to
<hostname>/<path-to-clone>/tests/functional/index.php