Mecha CMS

Deep learning on using the API.

Class Plugin

Author: Taufik Nurrohman · 66 Views

Tweet

Working with plugins.

Table of Content

Info: This class is located in lot\extend\plugin\engine\kernel folder.

Exist 

Plugin::exist($input, $fail = false);

Return the folder path of current plugin folder if exists:

if ($path = Plugin::exist('markdown')) {
    // do something with `$path`…
}

State 

Plugin::state($id, $key = null, $fail = false);

Return the stored plugin states if any, otherwise, return $fail:

$state = Plugin::state('markdown');

Note: If $key is array, then it will going to be the alternate values of the $state output if some data are not available:

$state = Plugin::state('markdown', [
    'table_class' => 1 // add `table_class` property to `$state` if missing
]);

Related: Plugin

0 Comments

No comments yet.