Use PHP files in node, as Express view engine
JavaScript PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
example-evalphp.js
example-expressapp.js
index.js formatting Jan 31, 2014
index.php
package.json fix examples Sep 17, 2012

README.md

php-node

###Use PHP in nodejs, as Express view engine

Push get, post variables into $_GET, $_POST - coming soon..

$ npm install php-node

var render = require('php-node')({bin:"c://php//php.exe"});

render(__dirname+'/index.php', {}, function(e, r) {
    console.log(r);
})

// use PHP as view engine in Express
var express = require('express'),
	app = express(),
	phpnode = require('php-node')({bin:"c:\\php\\php.exe"});

app.set('views', __dirname);
app.engine('php', phpnode);
app.set('view engine', 'php');

app.all('/index.php', function(req, res) {
   res.render('index');
})

var port = process.env.PORT || 3000;
app.listen(port, function() {
  console.log("Listening on " + port);
})