Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Fixed #30 #39

Merged
merged 1 commit into from
Apr 25, 2019
Merged

Fixed #30 #39

merged 1 commit into from
Apr 25, 2019

Conversation

shinsenter
Copy link
Owner

Manually add defer.js library script tag

In some regions, you may want to serve defer.js library locally due to The General Data Protection Regulation (EU).

// Include the library
require_once __DIR__ . '/vendor/shinsenter/defer.php/defer.php';

// Create a Defer object
$defer = new \shinsenter\Defer();
$defer->manually_add_deferjs = true;

// Then get the optimized output
$result = $defer->fromHtml(file_get_contents('mypage.html'))->toHtml();
var_dump($result);

@shinsenter shinsenter merged commit ff9b9a3 into master Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant