Thursday 27 April 2017

NodeJs Application need guide in implementing php as template

Can anyone please guide me through to implement PHP as template for NodeJS application. I am planning to use : PHP to load only the front-end html template (security purpose) ExpressJs as my backend.

I got struck in implementing the same here i am attaching the code below :

var phpnode = require("php-node");
app.engine('php', phpnode);
app.set('view engine', 'php');

and I am trying to load template like this :

router.get('/index.php', function(req, res, next) {
    res.render('index.php');
});



via Dineshvenkat S

No comments:

Post a Comment