Open Source PHP UI Implementation. Use this prebuilt HTML generation library to save time when writing a HTML webpage. Support for Bootstrap coming soon.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


HTML? Forget it.

You can now get started with phpUI. HTML is the basis of any website, but with phpUI you can have all your HTML generated automatically for you

Generating a Bootstrap DateTimePicker has never been easier. Before:

<input id='date_picker' class='form-control' type='text' value='06/04/2016' name='start_date' placeholder='Enter a Date'>
<script type='text/javascript'>$(document).ready(function(){$("#date_picker").datetimepicker();});</script>


echo new UIDatePicker('06/04/2016','start_date','Enter a Date');

##Advantages of phpUI

  • Create large HTML structures with minimal lines of code
  • Avoid continuously switching between PHP and HTML
  • phpUI code is much more readable than basic HTML, for example, the date picker above
  • Produces no-white-space HTML to improve network transfer speeds
  • Built in support for commonly used libraries including Bootstrap, select2 and CKEditor
  • Built in support to export your phpUI tables to HTML or download as Excel file
  • Ability to quickly update all UI objects throughout your site.
  • Allows you to pass elegant UI objects rather than messy HTML strings between model and controller classes
  • Fully open source


  • Clone with Git:
git clone
  • Create a new PHP Document.
  • Require the phpUI Autoloader
require_once 'phpUI/autoloader.php';
  • Use phpUI Elements as according to the documentation (coming soon)
echo new UIPage(
    new UIPageHead(
        'Example phpUI Page',
            CSSObject::libraryLink('bootstrap', '3.3.2'),
    new UIPageBody(
            //Insert Page Content objects here.
            JSObject::libraryLink('jquery', '2.2.3'),
            JSObject::libraryLink('bootstrap', '3.3.2')
  • Your IDE should automatically import the necessary objects for you.
use phpHTML\UICore\UIPage\UIPage;
use phpHTML\UICore\UIPage\UIPageBody;
use phpHTML\UICore\UIPage\UIPageHead;
use phpHTML\JSCore\JSObject;
use phpHTML\JSCore\CSSObject;
  • phpUI generates the HTML for you
<!doctype html>
<html lang="en-GB">
        <title>Example phpUI Page</title>
        <link rel='stylesheet' type='text/css' href=''>
        <link rel='stylesheet' type='text/css' href='css/my-bootstrap-theme.min.css'>
        <script type='text/javascript' src=''></script>
        <script type='text/javascript' src=''></script>