About Features Downloads Getting Started Documentation Events Support GitHub

Site Tools


development:code_generators

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
development:code_generators [2018/10/24 15:26]
demiankatz
development:code_generators [2018/10/24 15:27] (current)
demiankatz [Usage]
Line 171: Line 171:
   * MyModule\\PluginType\\PluginName is the name of the class you wish to create. The generator will use the first part of the class name to determine which module it belongs in (since modules correspond to namespaces);​ it will use the last part of the class name to name the class being defined; it will use the middle part to identify what type of plugin is being created and to set up configuration accordingly. Obviously, if you specify a class name that does not correspond with a standard VuFind plugin type, the generator will fail.   * MyModule\\PluginType\\PluginName is the name of the class you wish to create. The generator will use the first part of the class name to determine which module it belongs in (since modules correspond to namespaces);​ it will use the last part of the class name to name the class being defined; it will use the middle part to identify what type of plugin is being created and to set up configuration accordingly. Obviously, if you specify a class name that does not correspond with a standard VuFind plugin type, the generator will fail.
   * [optional factory name] may be included to specify the name of an existing factory that should be used to construct your plugin. For example, if your class will not have any dependencies,​ you can use the simple Zend\\ServiceManager\\Factory\\InvokableFactory to construct the object in a simple fashion. If you do not specify a factory name, the generator will create a factory automatically,​ naming it by taking your class name and appending "​Factory"​ on the end.   * [optional factory name] may be included to specify the name of an existing factory that should be used to construct your plugin. For example, if your class will not have any dependencies,​ you can use the simple Zend\\ServiceManager\\Factory\\InvokableFactory to construct the object in a simple fashion. If you do not specify a factory name, the generator will create a factory automatically,​ naming it by taking your class name and appending "​Factory"​ on the end.
 +
 +==== Notes ====
 +:!: Be sure that MyModule already exists and is included in your VUFIND_LOCAL_MODULES environment variable, or the generator may not work correctly. If MyModule does not yet exist, you can re-run VuFind'​s install.php script to create it.
 +
 +:!: If things don't work right away after generating code, you may need to clear your local/cache directory to get rid of outdated configurations.
  
 ==== Example ==== ==== Example ====
development/code_generators.txt · Last modified: 2018/10/24 15:27 by demiankatz