GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - myerscode/templex: A lightweight, regex based template rendering engine for PHP

BranchesTags
Open more actions menu

Latest commit

 

History

87 Commits
87 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
phpstan.neon
phpstan.neon
 
 
phpunit.xml
phpunit.xml
 
 
pint.json
pint.json
 
 

Repository files navigation

Templex

A lightweight, regex based template rendering engine for PHP

Latest Stable Version Total Downloads PHP Version Require License Tests codecov

Why this package is helpful?

Templex lets you define stubs and hydrate them using PHP variables. The engine uses regex for all processing — no eval(), no including and running code as PHP. This means you can safely generate new PHP files, config files, or any text-based content from templates.

Requirements

  • PHP 8.5 or higher

Install

composer require myerscode/templex

Quick Start

use Myerscode\Templex\Templex;

$templex = new Templex(__DIR__ . '/templates/', 'stub');

echo $templex->render('welcome', ['name' => 'Fred']);

Where templates/welcome.stub contains:

Hello <{ $name }>!

Documentation

  • Templates — template syntax, file types, and configuration
  • Slots — includes, conditions, loops, switch statements, and variables

Example Guides

  • Condition Examples
  • Foreach Examples
  • For Loop Examples
  • Switch Statement Examples

Issues

Bug reports and feature requests can be submitted on the Github Issue Tracker.

Contributing

Contributions are welcome! Please see contributing.md for guidelines on how to contribute to this project.

License

The MIT License (MIT). Please see License File for more information.

About

A lightweight, regex based template rendering engine for PHP

Topics

phptemplatetemplate-enginetemplatestemplatingtemplating-library

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.