Skip to content

Commit

Permalink
added resource flag to controller command
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Apr 25, 2018
1 parent d7b22c9 commit a75fb57
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion masonite/commands/ControllerCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class ControllerCommand(Command):
Creates a controller
controller
{name : Name of the view you would like to create}
{name : Name of the controller you would like to create}
{--r|--resource : Create a controller as a resource}
"""

def handle(self):
Expand All @@ -22,4 +23,18 @@ def handle(self):
f.write(' def show(self):\n')
f.write(' pass\n')

if self.option('resource'):
f.write('\n def index(self):\n')
f.write(' pass\n\n')
f.write(' def create(self):\n')
f.write(' pass\n\n')
f.write(' def store(self):\n')
f.write(' pass\n\n')
f.write(' def edit(self):\n')
f.write(' pass\n\n')
f.write(' def update(self):\n')
f.write(' pass\n\n')
f.write(' def destroy(self):\n')
f.write(' pass\n')

self.info('{0} Created Successfully!'.format(controller))

0 comments on commit a75fb57

Please sign in to comment.