Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best place to define plugins' constants?
#4
Carlos Wrote:
mvlcek Wrote:Another idea is: use only constants for default settings

I meant those default settings. A custom date format, things like that.

Also small plugins with no admin page, with just one or a few values to set up once.

In this case I suggest to use the following in your plugin:
Code:
if (!defined('myplugin_constant1')) define('myplugin_constant1', default_value);
The user can then define the constant in gsconfig.php, but if he doesn't, the default value is defined in the plugin itself.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Best place to define plugins' constants? - by mvlcek - 2011-07-15, 04:27:41



Users browsing this thread: 1 Guest(s)