Versions Compared

Key

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

...

Expand
titleShow plugin branding in 3.0

All that any plugin truly requires is branding. These options come from three methods: getName(), getVersion(), getAuthors().

Code Block
languagephp
title/plugins/my_plugin/my_plugin_plugin.php
linenumberstrue
<?php
class MyPluginPlugin extends Plugin {

    ...

    public function getName() {
		return "MyPlugin";
    }

	public function getVersion() {
		return "1.0.0";
	}

	public function getAuthors() {
		return array(
			array(
				'name' => "MyCompany",
				'url' => "http://www.mycompanyplugindevelopment.com"
			)
		);
	}
}
?>

The getAuthors() method requires a multi-dimensional array, so you can specify multiple authors if needed.

Lastly, each plugin needs a logo. By default these are loaded from /plugins/my_plugin/views/default/images/logo.png. You can override the location of the logo file by implementing the getLogo() method in your plugin.

Code Block
languagephp
title/plugins/my_plugin/my_plugin_plugin.php
linenumberstrue
<?php
class MyPluginPlugin extends Plugin {
    ...
    public function getLogo() {
        return "views" . DS . "default" . DS . "images" . DS . "some_other_logo.png";
    }
}
?>
Info
titleInternationalize it!

Use the Language library to help internationalize your plugin. Just create a language directory in your plugin, then a directory for each language (i.e. /plugins/my_plugin/language/en_us/) and place your language files in there. See Translating Blesta for how to load, format, and use language definitions.

...