# zf2-cli
Make Zend Framework 2 fancier by providing a commandline tool to
automate mundane tasks such as initializing a base project, creating
modules, models, controllers, etc.


## Installation

```bash
sudo npm install -g zf2-cli

```

## Usage
zf2 <command> <options>

## Commands

init              - initializes a Zend Framework 2 project based 
create-module     - creates a module
create-model      - creates model object and corresponding TableGateway

## Examples

### Initializing a project

Initialize an existing directory as a ZF2 project

```bash
mkdir project-name
cd project-name
zf2 init

```

Initialize a new directory as a ZF2 project

```bash
zf2 init my-project

```

### Creating a Module

Creates a new Module under module and updates
config/application.config.php.

```bash

zf2 init my-project
cd my-project
zf2 create-module Album

```

You can also create multiple modules in one fell swoop
```bash

zf2 init my-project
cd my-project
zf2 create-module Album User Advertisements

```

### Creating a model

```bash

cd module/Album
zf2 create-model Album

```

You can also specify fields in the create operation


```bash

cd module/Album
zf2 create-model Album title artist releaseDate

```

This operation will create a model object with a corresponding
TableGateway. It will also update the module's Module.php file to
contain the needed servcie configuration to register the TableGateway
with the service map.

