THT is in early Beta. We welcome contributors & feedback.
THT Hypertext Toolkit
THT is a language for web development. It transforms PHP into a more secure & modern tool, while remaining quick & easy to use.
PHPTHT
Supported on all major web hosts
No build steps -- just edit & refresh
Built-in templating
Familiar, modern syntax-
Includes web framework-
Organized standard library-
Formatted errors & stack traces-
UTF-8 default in string functions-
Protection from injection attacks-
Uses security best practices by default-

A Quick Look 

You don’t need to know PHP to use THT.

// THT has a familiar JavaScript-like syntax.
let colors = ['red', 'blue'];
colors.push('yellow');

// The Web module has methods for common tasks,
// like returning a complete HTML5 document.
Web.sendPage({
    title: 'Primary Colors',
    body:  bodyHtml(colors),
});

// Template functions let you include HTML in your
// scripts in a clean, organized way.
template bodyHtml(colors) {

    <h1>Primary Colors</h1>
    <ul>
    :: for (color in colors) {
        <li>{{ color.toUpperCaseFirst() }}</li>
    :: }
    </ul>
}

See the Syntax Cheat Sheet or full Language Tour.

Built on PHP (The Good Parts) 

THT keeps the parts of PHP that make its workflow quick & easy to understand:

1. Simple Routes

Creating a new page URL can be as simple as adding a new .tht file. Unlike PHP, the extension is not part of the URL.

2. Save & Refresh

When you update your code, it’s automatically transpiled to PHP (and cached). No extra build steps are necessary.

3. Atomic Requests

State and data are automatically cleaned up after every request.

See How THT compares to PHP, for a full comparison.

Web Framework 

THT includes many (optional) tools that are useful for modern web development:

Security 

By default, THT defends against the most common security risks.

Some of the security enhancements include:

See all security enhancements.

Performance 

Out of the box, PHP is more than fast enough for most apps. But you can benefit even more by the speed gains in PHP 7, or an opcode cache like APC.

On a MacBook Pro, the THT test suite (700 tests) finishes in 75 milliseconds. This includes the full range of file and database operations.

THT provides a Perf module to identify any performance bottlenecks in your app (usually database calls).

You can use the Cache module to eliminate the most common performance hits.

You Might Like THT If... 

Give It a Try 

THT is still in Beta, but if you’d like to try it out, it’s already capable of making basic web apps.