Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
Coffee edited this page Jun 4, 2022 · 4 revisions

Welcome to the SpfPhp wiki!

SpfPhp is a library to easily integrate existing PHP sites or a standard knowledge of HTML with YouTube's SPF.js library for implementing dynamic page loading in Javascript via progressive enhancement.

Much of what is true about SPF.js also applies to SpfPhp. Make sure you understand how to work with it before trying this out.

That said, SpfPhp tries to be as user-friendly as possible, allowing interaction through simple progressive enhancement of HTML via the addition of attributes.

Example

<?php
SpfPhp::beginCapture();

?>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <div id="content" x-spfphp-capture>Hello world!</div>
    </body>
</html>
<?php

// Then tell SpfPhp we need it
SpfPhp::autoRender();
Clone this wiki locally