Accessing Configuration Properties in Perl
Finally, whenever you need to access the value entered by the system administrator for a configuration directive, you can do so using some very simple Perl code:
use MT;
sub some_method {
my ($foo) = @_;
my $log = MT->config('CustomErrorLog');
# do stuff
}
Note: One thing of interest is the static reference to MT. MT is actually a singleton and as a result there is no need for a developer to instantiate an instance of MT each an every time they need to access its context.
This page is part of the Movable Type Developer Guide
- Previous Aliases
This page was last updated on 2008-09-17, 14:41.
Leave a note
Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.