Inversion 'config' tag.
A tag that dynamically alters the behavior of the template.
<?config comment_start: ?>
<?config comment_end: ?>
<?config
on_render_error: propagate
debugging_comments: true
comment_start:
comment_end:
?>
<?config { comment_start: "/*", comment_end: "*/" } ?>
The config options that will be modified
Create a new ConfigTag with the specified
body.
# File lib/inversion/template/configtag.rb, line 33
def initialize( body, linenum=nil, colnum=nil )
raise Inversion::ParseError, 'Empty config settings' if
body.nil? || body.strip.empty?
opts = YAML.load( body )
@options = symbolify_keys( opts )
super
end
Override the options in the parsestate when the config is
appended to the tree.
# File lib/inversion/template/configtag.rb, line 54
def before_appending( parsestate )
parsestate.options.merge!( self.options )
end
Override the options in the renderstate when the config is
rendered.
# File lib/inversion/template/configtag.rb, line 60
def before_rendering( renderstate )
renderstate.options.merge!( self.options )
end