PHPackages                             xantico/xantico - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. xantico/xantico

ActiveLibrary[Templating &amp; Views](/categories/templating)

xantico/xantico
===============

A PHP helper to build Bootstrap compatible html code automatically using OOP syntax.

0.7(7y ago)110GPL-3.0PHPPHP &gt;=5.3

Since Jan 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/StevensonKuo/Xantico)[ Packagist](https://packagist.org/packages/xantico/xantico)[ Docs](http://xantico.yhvh.tw)[ RSS](/packages/xantico-xantico/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)DependenciesVersions (2)Used By (0)

Xantico
=======

[](#xantico)

A PHP helper to build Bootstrap compatible html code automatically using OOP syntax.

Demo
----

[](#demo)

Please check demo pages here:

[Basic CSS](http://xantico.yhvh.tw/).

[Components](http://xantico.yhvh.tw/index.php?page=components).

[Bootstrap theme](http://xantico.yhvh.tw/index.php?page=theme).

[Tutorial Video](https://www.youtube.com/watch?v=6psvQBJ8EZg&feature=youtu.be)

This page is all the same with a demo page on Bootstrap official website. I write my php code below to show you how to achieve it. Also the worth part is to have a chance looking at html source code.

What is Xantico
---------------

[](#what-is-xantico)

This name is owned by a Mayan fire god. Btw it looks cool so I decide use it to name my code, a project of auto. generating bootstrap html code by PHP object oriental programming. It's very helpful if you are working a lot on building contents management system with PHP.

How to use Xantico (Installation)
---------------------------------

[](#how-to-use-xantico-installation)

1. Put all files under model/ folder into where your models live.
2. Things under controller/ and view/ folders are not necessary.
3. Include models how you usually do.
4. Enjoy it!

A fashion way to install, by composer:

```
composer require xantico/xantico

```

System requirements
-------------------

[](#system-requirements)

- PHP &gt;= 5.4, I use traits feature.
- My development environ. is under XAMPP v3.2.2. Using Boostrap 3.3.7 standards.

Start a Bootstrap palette
-------------------------

[](#start-a-bootstrap-palette)

Once your can access my model, you can start your painting! The first thing you need to do is initialize a palette.

```
$btPalette = new Xantico();
```

(you can see my sample code in view/BootstrapView.php.)

Although I wish that there ain't too many prepare works to do, you still have to decide where you to load Bootstrap CSS/JS. I wrote down their CDN path inside Bootstrap model as const. var, and you can call them by this way:

```
$btPalette->setIsLoadBootstrapFromCDN()->setIsLoadJQueryFromCDN();
```

There are something optional to load more for my samples:

```
$btPalette->setCustomCSSFiles("https://v3.bootcss.com/dist/css/bootstrap-theme.min.css");
// Bootstrap theme CSS.
$btPalette->setCustomScriptsFiles('https://v3.bootcss.com/assets/js/docs.min.js');
// Bootstrap tutorial page CSS.
```

(There still one line for customizing Style Sheet contents. I am going to skip it.)

Then you can start to put some color!

### Create a Jumbotron for instance

[](#create-a-jumbotron-for-instance)

```
$jumbotron = new Jumbotron();
```

The same thing you initialize a class named Jumbotron. in below what component you want to use, there shall be a name matched class you'd like to initialize, like buttons (Button), labels (Label) or tables (Table) etc...

Give some text to the jumbotron (all setters return $this instance, you can operate in chain like Javascript):

```
$jumbotron->setHeader("Theme example")
    ->setText("This is a template showcasing the optional theme stylesheets included in Bootstrap. Use it as a starting point to create something more unique by building on or modifying it.");
```

Almost done. Then you need a container to put your jumbotron in:

```
$container = new Container();
$container->setInnerElements($jumbotron);
```

Now we finish it and render the HTML for your results.

```
$btPalette->setBodyContents($container);
$btPalette->render(true); // the argument is for printing out result directly.
```

To switch to browser and key in the URL where you access your web page to see what does happen. There are bunch of beautiful, disciplined and well-formatted html code generated, and they are Bootstrap!.

My sample code mimics almost all of Bootstrap official guide web-page. This project would wish to keep this rhythm to create more useful Bootstrap model classes, even a full set of Bootstrap theme. You can use them on works directly.

If you like it, check more from the docs. Have a nice day!

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2686d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e9e00f40b3938e83a13e44ea6038cb1981d720e5814b9a052d919278da5ebe6?d=identicon)[StevensonKuo](/maintainers/StevensonKuo)

---

Top Contributors

[![StevensonKuo](https://avatars.githubusercontent.com/u/42029775?v=4)](https://github.com/StevensonKuo "StevensonKuo (59 commits)")

---

Tags

bootstrapbootstrap-themebootstrap3oopphptime-is-moneybootstrapview-model

### Embed Badge

![Health badge](/badges/xantico-xantico/health.svg)

```
[![Health](https://phpackages.com/badges/xantico-xantico/health.svg)](https://phpackages.com/packages/xantico-xantico)
```

###  Alternatives

[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[acacha/admin-lte-template-laravel

AdminLTE template applied to Laravel Scaffolding

1.8k387.2k8](/packages/acacha-admin-lte-template-laravel)[braincrafted/bootstrap-bundle

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.

3932.0M33](/packages/braincrafted-bootstrap-bundle)[infyomlabs/adminlte-templates

AdminLTE templates for InfyOm Laravel Generator

2681.6M7](/packages/infyomlabs-adminlte-templates)[bk2k/bootstrap-package

Bootstrap Package delivers a full configured frontend theme for TYPO3, based on the Bootstrap CSS Framework.

357891.4k72](/packages/bk2k-bootstrap-package)[kartik-v/yii2-popover-x

An extended bootstrap 3.0 popover widget which combines both the bootstrap popover and modal features and includes various new styling enhancements.

233.4M8](/packages/kartik-v-yii2-popover-x)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
