Usage of Dumper for the developer
Use it from other plugin.
It is possible to use it from other plugin by the following way.
Example
require MT;
my $app = MT->instance;
my $dumper = $app->component('Dumper');
my %config_hash = (
'dump_entry' => 1,
'dump_entry_yaml' => 1,
'dump_entry_yaml_file' => 'entries.yaml',
'dump_entry_fields' => {
'id' => 'id', # Outout id field.
'title' => 'name', # Output title field as name.
'permalink' => 'permalink', # Output Permalink.
'entry_email' => 'email', # Output Custom Fields field that specified by tagname.
},
);
foreach my $k (keys %config_hash) {
$dumper->set_config_value($k, $config_hash{$k}, 'blog:1');
}
出力例(entries.yaml)
---
1:
id: 1
name: entry's title
permalink: http://tec.toi-planning.net/entry/permalink/
email: taku@toi-planning.net
This entry was posted on Tuesday, September 23rd, 2008 at 10:22 PM and is filed under Dumper. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.