$ wp mwp add-class <slug> <classname>
This command adds a correctly namespaced class to your plugin in the
<slug>(required) The slug (directory) of the plugin to add to
<classname>(required) The name of the new class (namespaced relative to the plugin)
--type=<type>(optional) The type of class to scaffold. (‘generic’, ‘model’, ‘singleton’, ‘controller’)
When specifying a class using the
--type parameter, the following values are allowed:
generic: Generate a bare bones class. This is the default if no type is specified.
model: Generate a class which extends the
ActiveRecordclass to be used for a model.
singleton: Generate a class which extends the
Singletonclass to be used for a singleton.
controller: Generate a generic controller class which extends the
model_controller: Generate a controller that can be used for CRUD management of
$ wp mwp add-class acmecompany-gizmo Utility\Helper --type=singleton
Creating new plugin class file...
Class added successfully.