Skip to content

fukionline/SpitFire.JS.php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

SpfPhp was mostly a Rehike-specific hack that should have been worked around a long time ago. For more efficient performance, this project will be deprecated and Rehike will move away from it in the future.

If you are a third-party user of the SpfPhp library, then feel free to make a fork and continue maintaining it.

SpfPhp

A PHP library that parses and transforms HTML into the JSON required by YouTube's SPF.js.

Installation

The recommended installation method is via Composer:

composer require rehike/spfphp

After installation, use the library like such:

require "vendor/autoload.php"; // Include Composer packages

use SpfPhp\SpfPhp;

Get started

SpfPhp is designed with the most portability in mind. With that, it does not require the use of or integrate with any particular templating engine.

To use this with any templating engine, or just PHP alone, simply wrap all output with these following functions:

<?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();

Acknowledgements

SpfPhp makes use of the following open-source software:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%