Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:code_generators
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
development:code_generators [2018/10/24 15:26] – demiankatz | development:code_generators [2023/11/09 21:14] – demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Code Generators ====== | ====== Code Generators ====== | ||
- | Starting with VuFind | + | Starting with VuFind® |
===== Creating Routes ===== | ===== Creating Routes ===== | ||
- | Adding new entries to the Zend Framework | + | Adding new entries to the router |
==== Static Routes ==== | ==== Static Routes ==== | ||
Line 40: | Line 40: | ||
===== Creating Themes ===== | ===== Creating Themes ===== | ||
- | Starting with VuFind | + | Starting with VuFind® |
==== Usage ==== | ==== Usage ==== | ||
Line 51: | Line 51: | ||
===== Creating Theme Mix-ins ===== | ===== Creating Theme Mix-ins ===== | ||
- | Starting with VuFind | + | Starting with VuFind® |
==== Usage ==== | ==== Usage ==== | ||
Line 59: | Line 59: | ||
</ | </ | ||
- | ===== Overriding Existing Plugins and Services (VuFind | + | ===== Overriding Existing Plugins and Services (VuFind® |
- | If you want to extend one of VuFind's built-in plugins or services, you can use the ' | + | If you want to extend one of VuFind®'s built-in plugins or services, you can use the ' |
- | :!: Starting with VuFind | + | :!: Starting with VuFind® |
==== Usage ==== | ==== Usage ==== | ||
Line 72: | Line 72: | ||
</ | </ | ||
- | * path/ | + | * path/ |
* MyModule is the name of your local module where you wish to create a new class. | * MyModule is the name of your local module where you wish to create a new class. | ||
==== Notes ==== | ==== 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 | + | :!: 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 |
:!: 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. | :!: 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. | ||
Line 84: | Line 84: | ||
==== Example ==== | ==== Example ==== | ||
- | Suppose you wish to create a custom subclass of VuFind's SolrMarc record driver. You can see in module/ | + | Suppose you wish to create a custom subclass of VuFind®'s SolrMarc record driver. You can see in module/ |
<code php> | <code php> | ||
Line 116: | Line 116: | ||
</ | </ | ||
- | ===== Overriding Existing Plugins and Services (VuFind | + | ===== Overriding Existing Plugins and Services (VuFind® |
- | If you want to extend one of VuFind's built-in plugins or services, you can use the ' | + | If you want to extend one of VuFind®'s built-in plugins or services, you can use the ' |
==== Usage ==== | ==== Usage ==== | ||
Line 127: | Line 127: | ||
</ | </ | ||
- | * --extendfactory is a switch which will cause the existing factory method to be cloned into your local module. If you omit the switch, the existing factory will be used. :!: Using the existing factory only makes sense for factories that dynamically determine the name of the constructed object using the service name; however, a significant number of VuFind | + | * --extendfactory is a switch which will cause the existing factory method to be cloned into your local module. If you omit the switch, the existing factory will be used. :!: Using the existing factory only makes sense for factories that dynamically determine the name of the constructed object using the service name; however, a significant number of VuFind® |
* Fully\\Qualified\\ClassName is the name of the class you wish to extend/ | * Fully\\Qualified\\ClassName is the name of the class you wish to extend/ | ||
* MyModule is the name of your local module where you wish to create a new class. | * MyModule is the name of your local module where you wish to create a new class. | ||
==== Notes ==== | ==== 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 | + | :!: 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 |
:!: 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. | :!: 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. | ||
Line 138: | Line 138: | ||
==== Example ==== | ==== Example ==== | ||
- | Suppose you wish to create a custom subclass of VuFind's SolrMarc record driver. The command to generate a custom extension of the default class is: | + | Suppose you wish to create a custom subclass of VuFind®'s SolrMarc record driver. The command to generate a custom extension of the default class is: |
<code bash> | <code bash> | ||
Line 158: | Line 158: | ||
===== Creating New Plugins ===== | ===== Creating New Plugins ===== | ||
- | :!: This feature was introduced in VuFind | + | :!: This feature was introduced in VuFind® |
- | If you want to create a new [[development: | + | If you want to create a new [[development: |
==== Usage ==== | ==== Usage ==== | ||
Line 169: | Line 169: | ||
</ | </ | ||
- | * 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); | + | * 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); |
- | * [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, | + | * [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, |
+ | |||
+ | ==== 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®' | ||
+ | |||
+ | :!: 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 ==== | ||
Line 190: | Line 195: | ||
Successfully updated / | Successfully updated / | ||
</ | </ | ||
+ | |||
+ | ===== Related Video ===== | ||
+ | |||
+ | See the [[videos: | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
development/code_generators.txt · Last modified: 2023/11/09 21:19 by demiankatz