Bootstrap layout generator in PHP
Clone or download
Pull request Compare This branch is 86 commits ahead, 1 commit behind JasonKaz:master.
Permalink
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
README.md Update README.md Oct 31, 2015
composer.json removed phpdoc dependency Oct 31, 2015
phpdoc.yml updated readme Oct 31, 2015

README.md

Whats the purpose of this project?

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

Features

  • 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:

<head>
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" >
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" >
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

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 https://github.com/kktuax/PHPStrap.git
cd PHPStrap/examples
composer install

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

http://localhost/PHPStrap/examples/example.php

API DOCS