PHPackages                             doublemcz/nette-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. doublemcz/nette-generator

ActiveLibrary

doublemcz/nette-generator
=========================

v1.0(10y ago)1194PHP

Since May 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/doublemcz/nette-generator)[ Packagist](https://packagist.org/packages/doublemcz/nette-generator)[ RSS](/packages/doublemcz-nette-generator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Nette component generator
=========================

[](#nette-component-generator)

Basic installation
------------------

[](#basic-installation)

via composer `composer require doublemcz/nette-generator`

Configuration
-------------

[](#configuration)

Activate by nette extension. Go to config.neon and append this to the file

```
extensions:
  console: Kdyby\Console\DI\ConsoleExtension
  generator: Doublemcz\NetteGenerator\DI\GeneratorExtension

```

You can specify several options to change generator behaviour. For example, commonly we save components under `app/Components` dir in the project. You can change it by `componentsDir`. There is a list of complete options:

```
generator:
  componentsDir: %appDir%/App/Components ## Default is %appDir%/Components
  componentNamespace: App\Components     ## Default is Components

  generators:
  	doctrineForm:
  		entityNamespace: App\Entities

```

Available commands
------------------

[](#available-commands)

- generate:form (Generates simple empty component with Nette Form, used i.e. for contact form)
- generate:doctrine-form (Generates a component with Nette Form based on Doctrine ORM)
- generate:component (Generates empty component)

Usage
-----

[](#usage)

You can generate a component by Console command (Kdyby/Console). For Doctrine Form just run this command from root of your project.

```
php www/index.php generate:doctrine-form

```

You will be asked to specify `name` and `entity name`. Name can be `UserForm` and `entity name` just `User`. After successfull creation you will get following structure

```
  app
    Components
