Yeoman, AngularJS and PHP
I recently started playing around with Slim.php and trying to build a semi-decoupled AngularJS app with Yeoman and a php restful API. One thing I needed to be able to do was serve the PHP files, which grunt-contrib-connect doesn’t do out of the box. So instead of making
connect middleware to do this, I found grunt-php, which claims to be a drop-in replacement for
grunt-php work in a Yeoman app, it couldn’t get any easier.
grunt-phpinto your yeoman app:
npm install --save-dev grunt-php
- Open your
Gruntfile.jsand replace all instances of
php.options, add the new property of
I haven’t done extensive tests, but for the most part this seems to work without issue. There is likely some cleanup that could take place, middleware removed and what not, but in a pinch you get PHP files served via PHP 5.4.0+.