PHPackages                             ox-harris/phpfront - 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. ox-harris/phpfront

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

ox-harris/phpfront
==================

phpFront is a server-side, DOM-based template engine. It implements the JQuery API with its powerful CSS3 selectors and chainable methods. It is heavily optimized for server-side rendering and template manipulation in web development. (No template syntaxes - because we hate them like everyone else does!)

v1.0.0(9y ago)319GPL-3.0PHPPHP &gt;=5.3

Since Jul 28Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ox-harris/phpfront)[ Packagist](https://packagist.org/packages/ox-harris/phpfront)[ Docs](https://ox-harris.github.io/phpfront/)[ RSS](/packages/ox-harris-phpfront/feed)WikiDiscussions master Synced 1mo ago

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

PHPFront
========

[](#phpfront)

PHPFront will help you read/write content on HTML templates from within your PHP application, read/write on attributes, traverse up/down the full document, manipulate - create, repeat, import, relocate, replace, remove - elements dynamically, produce a clean HTML output that represents your entire application. This is server-side rendering.

It implements the JQuery API with its powerful CSS3 selectors and chainable methods. It is well-tested and greatly optimized for use in websites and other PHP-based applications; built with love to bring all the ease and fun to your code, and a whole lot of new possibilities!

Installation
============

[](#installation)

Requirement
-----------

[](#requirement)

PHPFront requires a web server running PHP 5.3 or greater.

Installation
------------

[](#installation-1)

There are two options:

### With Composer

[](#with-composer)

```
composer require ox-harris/phpfront

```

### From Github

[](#from-github)

Download from Github: [github.com/ox-harris/phpfront/releases](https://github.com/ox-harris/phpfront/releases)

Extract the PHPFront zip file and you’ll discover the most important folder for use named ‘lib’. This folder contains the core working files. *This folder and its content are things you SHOULD NOT edit*.

Move the PHPFront folder to the frontend directory of your project or anywhere from the root directory of your project – depending on your application’s directory structure. Just make sure your application’s autoloader can pick up the PHPFront class when called – that’s if your project is bundled with an autoloader. Or simply note down the path to where you decide to put the PHPFront files so you can manually include this path during setup.

Test
====

[](#test)

To see if PHPFront is available for use, use `PHPFront::info()`. This should show a few lines of info. If you just want to test PHPFront or if your project is nothing more than basic, here is a test-case setup in numbered steps.

- Create a new php file named ‘app.php’ – just the name for this example.
- Copy the PHPFront folder to the same directory as the app.php file.
- Create a plain HTML page named ‘template.html’- one that contains no php tags – and put the file in this same directory.

Then in your app.php:
---------------------

[](#then-in-your-appphp)

- Include the PHPFront class.

    ```
    Include ‘PHPFront/lib/PHPFront.php’;

    // If you stored the PHPFront folder in a different location, your include path would change.
    // Where ‘path-to-PHPFront’ is your actual path to where you stored PHPFront
    Include ‘path-to-PHPFront/PHPFront/lib/PHPFront.php’;
    ```
- PHPFront is now available to our app.php script, so we instantiate it:

    ```
    $PHPFront = new PHPFront;
    ```
- Now, we hand PHPFront the template to use - our template.html page

    ```
    $PHPFront->setTemplate(‘template.html’);

    // If your stored template.html in a different location, your path would change.
    // Where ‘path-to-template is your actual path to where you stored template.html
    $PHPFront->setTemplate(‘path-to-template/template.html’);
    ```
- Now we can start reading and writing content on respective elements in the template with CSS3 selectors

    ```
    // For document title (title)
    $PHPFront->find(‘title’)->html(‘This is document title’);

    // For page heading 1 (h1)
    $PHPFront->find(‘h1’)->html(‘Hello World!’);

    // For page paragraph (p)
    $PHPFront->find(‘p’)->html(‘Here is my first PHPFront project’)->addClass('rounded-corners')->css('color', 'gray');

    // Load a HTML fragment into a DIV and manipulate its content
    $PHPFront->find('#container')->load(__DIR__.'/templates/table.html')->find('tr:even')->css('background-color', 'whitesmoke')
    ->parents('table')->attr('id', 'employee-table')->append('342John Doe');
    ```
- Finally, we render our page using PHPFront’s render() function

    ```
    $PHPFront->render();
    ```

And that’s it! Preview your app.php in a browser and experience the PHPFront's simplicity and neatness first time on your project!

---

Documentation
=============

[](#documentation)

 (FOR phpFront v1.0.0)

Feedback
========

[](#feedback)

All bugs, feature requests, pull requests, feedback, etc., are welcome. [Create an issue](https://github.com/ox-harris/phpfront/issues).

Follow Up
=========

[](#follow-up)

.

Visit

Authors
=======

[](#authors)

Oxford Harrison [ox\_harris@yahoo.com](mailto:ox_harris@yahoo.com)

License
=======

[](#license)

GPL-3.0 - See LICENSE

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Every ~153 days

Total

3

Last Release

3264d ago

Major Versions

v1.0.0.x-dev → v2.0.0.x-dev2017-05-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eb75f60ab82e826c59ed902cf04cd097bb137d0e2dd70875d8f4a1596bda8f9?d=identicon)[ox-harris](/maintainers/ox-harris)

---

Tags

chainable-methodscss3-selectordomdom-eventshtmlhtml-markuphtml-templatejqueryno-smartyserver-side-renderingtemplate-enginexpath-queriesphphtmltemplatingtemplate enginesyntaxless templating

### Embed Badge

![Health badge](/badges/ox-harris-phpfront/health.svg)

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

###  Alternatives

[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.4k3](/packages/talesoft-tale-pug)

PHPackages © 2026

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