A WebApp Generator for Yeoman: FlightPHP + MongoDB backend, AngularJS frontend.
npm install generator-flightangular
|8||downloads in the last week|
|22||downloads in the last month|
|Version||0.1.2 last updated 3 months ago|
|Keywords||yeoman-generator, angularjs, flightphp|
|Dependencies (6)||yeoman-generator, cli-color, underscore, underscore.string, domino, zepto-node|
A generator for Yeoman.
Yeoman FlightPHP and AngularJS Generators
This Yeoman generator builds simple AngularJS webapps with a FlightPHP REST API at the server side. (Using MongoDB as storage)
To install generator-flightangular from npm, run:
$ sudo npm install -g generator-flightangular
Then, initiate the generator from your desired deployment location.
$ yo flightangular
Anything in the "public" directory is exposed to the webserver.
The "server" directory contains PHP, "server/lib" is the default include path supplied to the autoloader.
To create a new set of CRUD routes, Controllers and Storage.
$ yo flightangular:crud
You'll be asked for a "singleName" and "pluralName" - The singleName is most often used, and refers to individual versions of the models and most class names, pluralName is used for lists/arrays of items.
Angular Routes created will be:
/pluralName/ - List all models in the db.
/singleName/create - Create a new item.
/singleName/:id - Display an item.
/singleName/:id/edit - Edit an existing item.
REST routes will be added for FlightPHP in "public/index.php"
PHP Controller and Storage model will be created in "server/lib/SingleName"
We don't do any validation on data going in or out of Mongo so to add more fields to your model, just add the inputs to the create and/or edit forms in /public/partials/singleName/create.html and /public/partials/singleName/edit.html and then they'll be available by magic.
To run PHPUnit tests, ensure you have run composer to deploy PHP components and have "./composer/bin" in your path so the executable can be found, or that PHPUnit is globally available from somewhere else.
Paul Freeman (@OddEssay). Made in Liverpool.