Versions Compared

Key

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

...

There are two parameters passed to the uninstall() method. The first ($plugin_id) is the ID of the plugin being uninstalled. Because a plugin can be installed independently under different companies you may need to perform uninstall logic for a single plugin instance. The second parameter ($last_instance) identifies whether or not this is the last instance of this type of plugin in the system. If true, be sure to remove all any remaining remnants of the plugin.

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

    ... 

    public function uninstall($plugin_id, $last_instance) {
        #
        # TODO: Place uninstallation logic here 
        #
    } 
} 
?>

...

Blesta facilitates error message passing through the use of the Input component. Simply load the Input component into your plugin and set any errors you encounter using Input::setErrors(). The setErrors() method accepts an array of errors. This can be a multiple multi-dimensional array (in the case of multiple errors triggered for the same input or criteria) or a single dimensional array. The first dimension should be the name of the input that triggered the error. The second dimension, if necessary, is used to identify the type of error encountered.

...