TramwayJS

Controller

Will add a new Controller file with a skeleton for methods and optionally add routes to the config.

Example

tramway create:controller ProductController --add-routes --actions get getOne create

Options

ArgumentCommand TypeTypeDefaultRequiredComments
nameargumentstringnoneyesThe name of the Controller class
diroptionstringcontrollersnoAn option to override the default folder the Controller class will be created in
actionsoptionarraynonenoAn array of methods the Controller will have
add-routesoptionbooleanfalsenoA flag to indicate that a route should be created when making the Controller
routes-diroptionstringconfignoAn option to override the default folder where the routing config will be placed
routes-filenameoptionstringroutesnoAn option to override the default filename of the routes config
versionoptionnumberlatestnoAn option to specify which version of the class to use