X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FProducer%2FTTSchema.pm;h=60cbf34c91c89c004088c0e2ded7ccda684e555d;hb=782b5a43519d2713171767f74a544fe9892542ea;hp=de9f7bcef50b212109e3bccc8f1fc79886dc3873;hpb=329fc3f0ed7c802fb5a15b7e882817a4db031d80;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Producer/TTSchema.pm b/lib/SQL/Translator/Producer/TTSchema.pm index de9f7bc..60cbf34 100644 --- a/lib/SQL/Translator/Producer/TTSchema.pm +++ b/lib/SQL/Translator/Producer/TTSchema.pm @@ -1,9 +1,9 @@ package SQL::Translator::Producer::TTSchema; # ------------------------------------------------------------------- -# $Id: TTSchema.pm,v 1.9 2004-11-25 23:10:58 grommit Exp $ +# $Id$ # ------------------------------------------------------------------- -# Copyright (C) 2002-4 SQLFairy Authors +# Copyright (C) 2002-2009 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -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