class TrustyCms::Config::Definition
def initialize(options={})
See the method documentation in TrustyCms::Config for options and conventions.
end
end
users.define 'allow_password_reset?', :label => 'Allow password reset?'
config.namespace('users', :allow_change => true) do |users|
TrustyCms::Config.prepare do |config|
The actual defining is done by TrustyCms::Config#define and usually in a block like this:
a config item is global or site-specific.
validate it when it changes. In the next update it will also allow you to declare that
to place limits on that behavior. It allows you to protect a config entry, to specify the values it can take and to
They're created when first mentioned and then available in all parts of the application. The definition mechanism is a way
By default radiant's configuration machinery is open and ad-hoc: config items are just globally-accessible variables.
Configuration 'definitions' are metadata held in memory that add restriction and description to individual config entries.
def initialize(options={}) [:empty, :default, :type, :notes, :validate_with, :select_from, :allow_blank, :allow_change, :allow_display, :units, :definer].each do |attribute| instance_variable_set "@#{attribute}".to_sym, options[attribute] end end