Introduction to Groundhoggs Custom Extension
Funnel elements are what makes magic happen in Groundhogg. We have thoughtfully designed a methodology for implementing custom actions & benchmarks which you can find below.
Groundhogg-extension is the main file of your extension. This file used to load all the loaders and setup all the essential path for the development of the plugin. This file also initializes the loaders. This file is well documented In case you want to change the name and define a custom path.
Plugin class is the most important class for the extension this is where initialization of the classes happens. This is an only class which is loaded by the main extension file. This class inherits Extension class of the Groundhogg and overwrites methods of the main class to hook custom code inside Groundhogg.
You can create an object of your custom class inside the init_components method which gets called during the initialization process of extension.
This class also creates an instance of autoloader class which is responsible for loading all files for the classes declared in the plugin file.
Autoloader class is another important class of extension. This class is responsible for loading all files which contain classes. Autoloader uses namespace structure for loading file Thus, implementation of namespaces is inevitable for custom development. Files are loaded when the object of the class gets created.
To cite an example: If you want to load contact file available in follwing location.
hen namespace declaration for contact file looks like follows.
NOTE: Autoloader support dashes and lowercase file names only. If your file name does not satisfy this condition or you don't have class in your file then you can manually load a file using includes method of Plugin Class.
Groundhogg extension contains templates for other classes which you can use to further integrate your extension with Groundhogg. You can create updater for your extension which inherits the Updater class of Groundhogg, You can also Implement an installer which deals with the initial installation process. Apart from that, you can also create custom roles for the marketers and sales manager using roles class as well.