Re: [Templates] remove space with backspace

2009-10-27 Thread Gert Brinkmann
Oleg Kostyuk wrote: > Probably, you need [%- and -%] instead of usual [% and %] ?... "To remove all whitespace including any number of newlines, use the '~' character instead." http://search.cpan.org/~abw/Template-Toolkit-2.22/lib/Template/Manual/Config.pod#PRE_CHOMP,_POST_CHOMP Greetings -- _

Re: [Templates] remove space with backspace

2009-10-29 Thread Gert Brinkmann
Rajesh Saha wrote: > Here, my problem is that I can't remove the white spaces around > "Jupiter" with [%- -%] tag. Additionally, I want "Council" should > be printed on the same line of "Hyper Space Planning". As I mentioned in a former mail try [%~ "Council" -%] instead of the "-"

Re: [Templates] remove space with backspace

2009-10-29 Thread Gert Brinkmann
Oleg Kostyuk wrote: >> btw.: AFAIK "people" does not exist in plural. > I'm not native English speaker, Me, too. And you are right: people=Leute (in german) peoples=Völker if I understand it correctly. Greetings, Gert ___ templates mailing list templ

[Templates] How to access the stash inside of methods?

2010-03-04 Thread Gert Brinkmann
Hello, I have implemented some classes and put one instance of them into the stash. Something like this: my $mine = MyClass->new(); my %vars = ( mine => $mine ); my $stash = Template::Stash::XS->new(\%vars); my $template = Template->new({ ... STASH => $stash, }) || die Template->err

Re: [Templates] How to access the stash inside of methods?

2010-03-04 Thread Gert Brinkmann
> Gert Brinkmann wrote on 4 Mar 2010 1:51 PM... >> >> Now my question: What is the best way to access the stash inside of a >> MyClass method? Felipe Gasper (cPanel) wrote: > It looks like you want to make a plugin, not something in the stash > itself. Generally,

Re: [Templates] problem with USE DBI

2010-03-22 Thread Gert Brinkmann
dark0s wrote: >[% query = "SELECT * FROM projects WHERE NameProject = $project" %] > DBI error - execute failed: Unknown column 'Prova' in 'where clause' > > Where is the problem? You have to use quotes I guess: SELECT * FROM projects WHERE NameProject = '$project' It would be better if

Re: [Templates] confused by CONFIGs

2010-08-07 Thread Gert Brinkmann
On 23.07.2010 01:09, Benjamin Hitz wrote: > PRE_CHOMP => 1, > POST_CHOMP => 1, Do you really want to chomp by default every tag? > blah blah XML > type="real"/> > type="real"/> > [% FOR att = xml_generic_atts %][% att

[Templates] Calling size on nothing returns 1?!

2010-09-27 Thread Gert Brinkmann
Hello, due to a bug in my template I did call the "size" method (that is meant for list variables normally) on an "undef" variable: [% test = unknown %] test.size=[% test.size %] where unknown is not a value. Or with a real value: [% test = 2 %] test.size=[% test.size %] Both print "test.size=

Re: [Templates] Calling size on nothing returns 1?!

2010-09-30 Thread Gert Brinkmann
On 27.09.2010 14:57, Gert Brinkmann wrote: > Why does it return 1 and not > nothing? Someone did send me the link to the manual: http://www.template-toolkit.org/docs/manual/VMethods.html#section_size size Always returns 1 for scalar values. This method is provided for consistency wi