-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathgenerate.controller.yml
More file actions
30 lines (30 loc) · 1.36 KB
/
generate.controller.yml
File metadata and controls
30 lines (30 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
description: 'Generate & Register a controller'
help: 'The <info>generate:controller</info> command helps you generate a new controller.'
welcome: 'Welcome to the Drupal Controller generator'
options:
module: 'The Module name.'
class: 'Controller Class name'
routes: 'The routes, must be an array containing [title, method, path]'
services: 'Load services from the container.'
test: 'Generate a test class'
questions:
module: 'Enter the module name'
class: 'Enter the Controller class name'
title: 'Enter the Controller method title (to stop adding more methods, leave this empty)'
method: 'Enter the action method name'
path: 'Enter the route path'
services: 'Enter your service'
test: 'Do you want to generate a unit test class?'
messages:
title-empty: 'Title must contain a value (you must enter at least one method)'
title-already-added: 'Title was already added'
method-name-already-added: 'Method name was already added'
path-already-added: 'Path was already added'
examples:
- description: 'Generate controller specifying the module name, the class name and its routes'
execution: |
drupal generate:controller \
--module="block" \
--class="DefaultController" \
--routes='"title":"ControllerMethod" | "name":"modulename.default_controller_hello" | "method":"hello" | "path":"/modulename/hello/{name}"' \
--test