Skip to content
Bootstrap layout generator in PHP
Branch: master
Clone or download
Pull request Compare This branch is 86 commits ahead, 1 commit behind JasonKaz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src/PHPStrap
.gitattributes
.gitignore
LICENSE
README.md
composer.json
phpdoc.yml

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

You can’t perform that action at this time.