Bootstrap layout generator

1.0.2 2015-11-01 19:10 UTC

This package is not auto-updated.

Last update: 2021-09-18 02:06:04 UTC


Using this library you can create Bootstrap's HTML markup easily using PHP.


  • Bootstrap 3 support
  • Nest components in object-oriented way
  • Extend the bootstrap components with custom styles
  • Form validation
  • Wizard component with dependant Forms

Quick start

A full working example is available in the repository.

Add the composer dependency:

"require": {
   "phpstrap/phpstrap": "1.*"

Issue a composer install o composer update if you already have composer installed for your project.

Include de composer autoload directive:

require_once __DIR__ . '/vendor/autoload.php';

Include Bootstrap's CSS+JS in your PHP, for example with the CDN:

	<link rel="stylesheet" href="" >
	<link rel="stylesheet" href="" >
	<script src=""></script>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

And start producing the HTML markup:

use PHPStrap\Panel;
$ExamplePanel = new Panel();
$ExamplePanel->addHeader("Example panel");
$ExamplePanel->addContent("My content");
echo $ExamplePanel;

Clone and run example

git clone
cd PHPStrap/examples
composer install

Deploy the examples folder to your PHP-enabled server, an open your browser: