Bootstrap layout generator in PHP
Clone or download
Pull request Compare This branch is 86 commits ahead, 1 commit behind JasonKaz:master.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples working example Oct 31, 2015
src/PHPStrap added missing function (form bugfix) Nov 1, 2015
.gitattributes Auto fixing line endings Jan 9, 2013
.gitignore working example Oct 31, 2015
LICENSE Minor updates to code and inclusion or composer file and license file Jan 10, 2013 Update Oct 31, 2015
composer.json removed phpdoc dependency Oct 31, 2015
phpdoc.yml updated readme Oct 31, 2015

Whats the purpose of this project?

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: