Image

Spawner

Spawn boilerplate code for any PHP application component

Development Boilerplate Generator PHP

Inputs

You can define multiple inputs in your definition file. Each input can be defined by a dictionary where the key is the ID of your input. The value of that dictionary defines what your input will do.

There are 2 types of Inputs

  • Ask
  • Confirm

Ask Input

Asks the user for a string input

inputs:
  name:
    input: ask
    message: What is name of the form ?
    default: DefaultForm
    validators:
      empty:
        message: Form name cannot be empty

This input accepts the following values

  • Message (Required) - The message that will appear to the user
  • Default (Optional) - Supplies a default value
  • Validators (Optional) - A set of validators that validates if the user input is correct. See Validators section for more details

Confirm Input

Asks the user for a yes or no answer

continue:
  input: confirm
  message: Do you want to confirm generation ?
  terminate: yes

This input accepts the following values

  • Message (Required) - The message that will appear to the user
  • Terminate (Optional) - A boolean value that will stop the entire script if set to true and user input is false