From: Mark Addison Date: Fri, 26 Nov 2004 00:28:06 +0000 (+0000) Subject: Template config is now passed using tt_conf producer arg. Deprecated passing X-Git-Tag: v0.11008~590 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d6bd3c7da3258a715d2eec383a91a6ce48c1520;p=dbsrgits%2FSQL-Translator.git Template config is now passed using tt_conf producer arg. Deprecated passing it in the producer_args directly. --- diff --git a/lib/SQL/Translator/Producer/TTSchema.pm b/lib/SQL/Translator/Producer/TTSchema.pm index de9f7bc..8601253 100644 --- a/lib/SQL/Translator/Producer/TTSchema.pm +++ b/lib/SQL/Translator/Producer/TTSchema.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::TTSchema; # ------------------------------------------------------------------- -# $Id: TTSchema.pm,v 1.9 2004-11-25 23:10:58 grommit Exp $ +# $Id: TTSchema.pm,v 1.10 2004-11-26 00:28:06 grommit Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -41,6 +41,11 @@ SQL::Translator::Producer::TTSchema - ttargs => { author => "Mr Foo", }, + + # Template config options + ttargs => { + INCLUDE_PATH => '/foo/templates', + }, }, ); print $translator->translate; @@ -70,19 +75,24 @@ Here's a brief example of what the template could look like: See F for a more complete example. The template will also get the set of extra variables given as a hashref via the -C producer arg. +C producer arg. You can set any of the options used to initiallize the Template object by -adding them to your producer_args. See Template Toolkit docs for details of +adding a tt_conf producer_arg. See Template Toolkit docs for details of the options. +(Note that the old style of passing this config directly in the producer args +has been deprecated). + $translator = SQL::Translator->new( to => 'TT', producer_args => { ttfile => 'foo_template.tt', ttargs => {}, - INCLUDE_PATH => '/foo/templates/tt', - INTERPOLATE => 1, + tt_conf = { + INCLUDE_PATH => '/foo/templates/tt', + INTERPOLATE => 1, + } }, ); @@ -101,10 +111,15 @@ limitless! The template file to generate the output with. -=item ttvars +=item tt_vars A hash ref of extra variables you want to add to the template. +=item tt_conf + +A hash ref of configuration options to pass to the L