First in your plugin you have to define the configurable property as "static public" like this the configuration Loader will be able to override the default value you set. Here is a sample of what your class looks like if there is only this property
Code: Select all
namespace ManiaLivePlugin\farfa\MyMegaPluginWhichKillEveryThings
class MyMegaPluginWhichKillEveryThings extends \ManiaLive\PluginHandler\Plugin
{
static property $myConfigurableProperty = 'myDefaultValue';
}
Code: Select all
namespace ManiaLivePlugin\farfa\MyMegaPluginWhichKillEveryThings
class MyMegaPluginWhichKillEveryThings extends \ManiaLive\PluginHandler\Plugin
{
static property $myConfigurableProperty = 'myDefaultValue';
function myCrazyMethod()
{
//This will display in the console the property value;
echo self::$myConfigurableProperty;
}
}
Code: Select all
;This is used to load the plugin
plugins.load[] = 'farfa\MyMegaPluginWhichKillEveryThings'
;This is the override of the default value
plugins.farfa\MyMegaPluginWhichKillEveryThings.myConfigurableProperty = 'myOverridingValue'