Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Now that we've looked at some of the basic of creating a module, let's take a look at all of the required methods each module must implement: Module Methods.

Registrar Modules

As of Blesta 5.1 we introduced a new type of module, the registrar module. Registrar modules are utilized by the Domain Manager plugin, which include specific functions for domain management. Registrar modules implement all the functions as standard modules in addition to the Blesta\Core\Util\Modules\Registrar interface.

Code Block
languagephp
title/module/my_module/my_module.php
linenumberstrue
<?php
use Blesta\Core\Util\Modules\Registrar;

class Namesilo extends Module implements Registrar
{
	...
	
	public function checkAvailability($domain, $module_row_id = null) {
		#
		# TODO: Check if the domain is available
		#
	}

	public function getExpirationDate($domain, $format = 'Y-m-d H:i:s', $module_row_id = null) {
		#
		# TODO: Get the expiration date of the domain
		#
	}

	public function getTlds($module_row_id = null) {
		// Returns a list of the TLDs supported by the module
		return [
			'.com',
			'.net',
			'.org'
		];
	}
	...
}