pastusiak/tiny-ssi-php

This package is abandoned and no longer maintained. No replacement package was suggested.

Tiny SSI - Apache Server Side Includes parser for PHP

v1.1.1 2018-03-29 22:36 UTC

This package is not auto-updated.

Last update: 2024-05-04 13:43:16 UTC


README

A minimal implementation of Apache SSI (server-side includes) for >= PHP 5.6

Usage

Supports:

  • include file
  • include virtual
  • set var
  • echo var
<!--#include virtual="ssi_test_header.html" -->

<!--#set var="title" value="My Title" -->

<div class="container">
    <h1><!--#echo var="title" --></h1>
    <p class="lead">
        contents
    </p>
</div>

<!--#include file="ssi_test_footer.html" -->

expecting that 'ssi_test_header.html' and 'ssi_test_footer.html' are in the same folder as the above html file, you can then do:

$parser = new Pastusiak\TinySSI();
$combined = $parser->parse('ssi_test_body.html');

License

MIT