Scan PHP files in Gulp and process include and require statements to inline HTML snippets. The following are all handled...
Requirements
Install
npm install php-include-html --save-dev
Examples
gulpfile.js ```javascript var gulp = require("gulp"); var pump = require("pump"); var phpinc = require("php-include-html"); var phpFiles = ["index.php"];
gulp.task("php",function(cb) { pump([ gulp.src(phpFiles), phpinc({verbose:true}), gulp.dest("build") ],cb); });
* index.php
```html
<!DOCTYPE html>
<html lang="en-gb">
<head>
<title>php-include-html</title>
<?php include("head.php");?>
</head>
<body>
<!-- etc -->
</body>
</html>
Configuration options
Treat me to a beer!
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Status
Author: Riklewis
Source Code: https://github.com/riklewis/php-include-html
License: MIT license