html-template-users Mailing List for HTML::Template
Brought to you by:
samtregar
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(42) |
Jul
(80) |
Aug
(77) |
Sep
(97) |
Oct
(65) |
Nov
(80) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(63) |
Feb
(47) |
Mar
(45) |
Apr
(63) |
May
(67) |
Jun
(51) |
Jul
(78) |
Aug
(37) |
Sep
(45) |
Oct
(59) |
Nov
(50) |
Dec
(70) |
2004 |
Jan
(23) |
Feb
(90) |
Mar
(37) |
Apr
(53) |
May
(111) |
Jun
(71) |
Jul
(35) |
Aug
(58) |
Sep
(35) |
Oct
(35) |
Nov
(35) |
Dec
(20) |
2005 |
Jan
(51) |
Feb
(19) |
Mar
(20) |
Apr
(8) |
May
(26) |
Jun
(14) |
Jul
(49) |
Aug
(24) |
Sep
(20) |
Oct
(49) |
Nov
(17) |
Dec
(53) |
2006 |
Jan
(12) |
Feb
(26) |
Mar
(45) |
Apr
(19) |
May
(19) |
Jun
(13) |
Jul
(11) |
Aug
(9) |
Sep
(10) |
Oct
(16) |
Nov
(17) |
Dec
(13) |
2007 |
Jan
(9) |
Feb
(12) |
Mar
(28) |
Apr
(33) |
May
(12) |
Jun
(12) |
Jul
(19) |
Aug
(4) |
Sep
(4) |
Oct
(5) |
Nov
(5) |
Dec
(13) |
2008 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(16) |
May
(3) |
Jun
(1) |
Jul
(12) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(1) |
May
|
Jun
(6) |
Jul
(5) |
Aug
(3) |
Sep
(7) |
Oct
(1) |
Nov
(15) |
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(3) |
Mar
|
Apr
(28) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(8) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Mark A. <pe...@ma...> - 2015-05-07 08:25:41
|
Question about TMPL_VAR and ESCAPE=HTML When using content such as ñ and a Chinese character like “字” they display just fine in the browser when we use a tag like: <!— TMPL_VAR NAME —> However, if we use: <!— TMPL_VAR NAME ESCAPE=“HTML” —> the values do not display as their character but rather the HTML encoded value: According to the documentation of HTML::Template escape HTML should only escape 5 characters: Replaces the following characters with their HTML entity equivalent: &, ", ', <, > However, it appears that it is doing more than just replacing those 5 characters with their HTML entity equivalent. It seems to be changing UTF-8 characters as well. When calling HTML::Template->new() we are specifying: utf8 => 1 The server is sending a Content-Type header of text/html; charset=UTF-8 and we also employ the meta-tag for specifying the charset. The HTML for the input tag looks like this: <input type=“text” name=“middlename” value=“<!— TMPL_VAR NAME=‘middlename’ ESCAPE=HTML—>” title=“Middle Name” /> Is this expected behavior? Is there a work-around? At this point the only solution I see is to do my own escaping of just any double quotes and then use the value in my TMPL_VAR without HTML escaping. By the way, we’ve been using HTML::Template for years and it’s become a key part of our software. We appreciate all that’s been done with it so far. — Mark |
From: Jacob L. A. <jan...@ge...> - 2014-01-20 20:50:37
|
Hi, Before I get into my "me too" validation bit, I want to express my thanks to Michael Peters and the others that have brought HTML::Template to where it is. I love the light-weight nature and assistance keeping presentation separate from business logic. Having the filters/escape values for html, js, and url is a great bonus. I recently gave Eclipse EPIC a hand and thought I may as well edit the HTML and template files in Eclipse as well, via it's built-in Web Tools Platform (WTP) code. Right away I ran into validation errors with attribute values that needed HTML::Template VARs, like this: <link rel="stylesheet" href="<!-- TMPL_VAR NAME=BASEURL -->/admin.css" type="text/css"> The WTP parser would get confused and say that the link tag wasn't closed, just like it did for Dietrich Streifert in his question from 5 Jul 2006. http://comments.gmane.org/gmane.comp.lang.perl.modules.html-template/1628 Scouring around, I came across the vanguard_compatibility_mode "error detection option" that I had been ignoring because I'm not at Vanguard Media. Using %BASEURL% instead of anything starting and ending with html-looking <> tags. This worked pretty well. Like others have been, I am concerned about the viability of using that flag based on it's name and documentation. Also, I miss the filter/escape available using the standard method and I wouldn't mind still having die_on_bad_params. http://search.gmane.org/?query=vanguard_compatibility_mode&group=gmane.comp.lang.perl.modules.html-template I appreciate the HTML comment (<!-- -->) option of HTML::Template. It helps a lot. I'm not a fanatic about valid HTML but these helpful IDEs are. I would love some optional syntax to use inside of tags so they don't look like unclosed start tags. Here are some initial ideas: 1) Have a percent_escapes option that acts like an alias to vanguard_compatibility_mode, except that it doesn't disable die_on_bad_params if possible. 2) Be able to select a filter, maybe with an extra leading character like this: * %:BASEURL% - HTML escape filter * %=BASEURL% - URL escape filter * %!BASEURL% - JavaScript escape filter or by replacing ~(TMPL_ PATTERN)~ with <TMPL_ PATTERN> like this: * ~TMPL_VAR NAME="BASEURL" ESCAPE="HTML"~ I prefer the first option. I hope this isn't feature creep. I appreciate that HTML::Template has provisions to be more pre-output validation friendly than other systems, including the prominent non-Perl ones. I was hoping that changes like this would close a frequently annoying hole in it's validation friendliness. Thank you for your thoughts, -- Jacob Anawalt Gecko Software, Inc. jan...@ge... 435-752-8026 |
From: Steven B. <bau...@ya...> - 2013-01-29 13:02:07
|
Dear Sir or Madam: im Steven Bauer http://chalikidikihomes.com/diet.php?qespcobjsgfp 29.01.2013 7:02:03 |
From: Philip T. <phi...@gm...> - 2012-05-29 13:05:43
|
On 29 May 2012 08:30, Boris Lobzov <bor...@gm...> wrote: > Description: > > TMPL_VAR used for same variable both in the loop and outside of the > loop, is empty when used within the loop. you need to set the global_vars flag when calling 'new'. See the docs here: http://search.cpan.org/~wonko/HTML-Template-2.91/lib/HTML/Template.pm#Miscellaneous_Options -- hello world |
From: Boris L. <bor...@gm...> - 2012-05-29 12:31:01
|
Description: TMPL_VAR used for same variable both in the loop and outside of the loop, is empty when used within the loop. Example: a table of account transactions. In PERL we fill the template with this code: my $acct_rec = HTML::Template->new(filename => $args{template}); $acct_rec->param(ACCOUNTID => $args{accountid}); my @loop_data = (); ... $sth->execute(@args{qw/accountid/}) or die "SQL Error: $DBI::errstr\n"; ## gets transactions from db while ($row = $sth->fetchrow_hashref) { my %tbl_row; # get a fresh hash for the row data $tbl_row{IS_CHARGE} = ($$row{trxtype} eq 'C') ? 1 : 0; $tbl_row{TRXID} = $$row{trxid}; $tbl_row{TRXDATE} = $$row{trxdate}; $tbl_row{UNAME} = $$row{uname}; $tbl_row{SNAME} = $$row{sname}; $tbl_row{QUANTITY} = $$row{quantity}; $tbl_row{PRICE} = $$row{price}; $tbl_row{AMOUNT} = $$row{amount}; push(@loop_data, \%tbl_row); } $acct_rec->param(TRX_LOOP => \@loop_data); -------------------------------------------------------------- Html template file <table border=0 cellspacing=2 cellpadding=2 width:100%> <tr style='color: #000000; background-color: #BBBBBB; font-size: 10pt'> <td>Account ID</td> <!-- THIS ONE WORKS --> <td><TMPL_VAR NAME="ACCOUNTID"></td> <!-- EOC --> </tr> <tr style='color: #000000; background-color: #BBBBBB; font-size: 10pt'> <th>Date</th> <th>User</th> <th>Charge/Payment</th> <th>Quantity</th> <th>Price</th> <th>Amount</th> <th>Comment</th> <th>Cancel</th> </tr> <TMPL_LOOP NAME="TRX_LOOP"> <TMPL_IF IS_CHARGE> <tr style='color: #000000; background-color: #FFFFCC; font-size: 10pt'> <TMPL_ELSE> <tr style='color: #000000; background-color: #CCFFCC; font-size: 10pt'> </TMPL_IF> <!-- THIS ONE DOESN'T WORK --> <td align=left><TMPL_VAR NAME="ACCOUNTID"></td> <!-- EOC --> <td align=left><TMPL_VAR NAME="TRXDATE"></td> <td align=left><TMPL_VAR NAME="UNAME"></td> <td align=left><TMPL_VAR NAME="SNAME"></td> <td align=center><TMPL_VAR NAME="QUANTITY"></td> <td align=right><TMPL_VAR NAME="PRICE"></td> <td align=right><TMPL_VAR NAME="AMOUNT"></td> <td align=left><TMPL_VAR NAME="COMMENT"></td> </tr> </TMPL_LOOP> </table> ---------------------------------------------- i.e. ACCOUNTID works outside the loop, inside the loop it stays empty Ubuntu 11/nginx + plack/perl 5.2.14/HTML::Template Module Version: 2.91 |
From: Roger B. W. <ro...@fi...> - 2011-11-20 15:45:19
|
On Sun, Nov 20, 2011 at 08:40:05AM +0100, Marcel van Dorp wrote: >I have an issue with your extension H::T::Set. > >In my template, I have: > >Debug: <TMPL_VAR NAME="VAL1"> ><TMPL_SET NAME="var1" ><TMPL_VAR NAME="VAL1"></TMPL_SET> If you're using _my_ Set.pm extension - which isn't on CPAN as far as I know - all you should have in the second line is <TMPL_SET NAME="var1" VALUE="VAL1"> It's possible that there's another one with a different syntax that I'm unaware of. Roger |
From: Marcel v. D. <ma...@va...> - 2011-11-20 07:40:27
|
On 11/17/2011 10:03 PM, Marcel van Dorp wrote: > On 11/17/2011 09:15 PM, Roger Burton West wrote: >> On Thu, Nov 17, 2011 at 05:59:27PM +0100, Marcel van Dorp wrote: >>> I would like to retrieve the default value from the template, eg. >>> TMPL_VAR NAME="VAR1" DEFAULT="DEFAULTVALUE1" >> My extension module, HTML::Template::Set, allows you to do >> >> <tmpl_set name="var1" value="defaultvalue1"> >> >> and retrieve this through the query interface. If this would be useful, >> let me know and I'll email you a copy. It predates the default= setting, Hi Roger, list, I have an issue with your extension H::T::Set. In my template, I have: Debug: <TMPL_VAR NAME="VAL1"> <TMPL_SET NAME="var1" ><TMPL_VAR NAME="VAL1"></TMPL_SET> and in my code: $tpl->param('val1' => "myValue"); # set TMPL_VAR $out = $tpl->param('var1'); # retrieve TMPL_SET But the last line returns nothing (I expected "myValue"). The output shows me the first 'Debug:' line, so I know the TMPL_VARs are correctly set. I've triple-checked the documentation on CPAN, but I do not see what I'm doing wrong. Can anyone help? Marcel >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure >> contains a definitive record of customers, application performance, >> security threats, fraudulent activity, and more. Splunk takes this >> data and makes sense of it. IT sense. And common sense. >> http://p.sf.net/sfu/splunk-novd2d >> _______________________________________________ >> Html-template-users mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/html-template-users > |
From: Roger B. W. <ro...@fi...> - 2011-11-17 22:59:26
|
On Thu, Nov 17, 2011 at 10:51:28PM +0100, Marcel van Dorp wrote: >Any chance this will be implemented soon? I can work around with SET >names related to LOOP names, but that is ugly. Very unlikely. Roger |
From: Marcel v. D. <ma...@va...> - 2011-11-17 21:51:51
|
ransfer-Encoding: 7bit On 11/17/2011 09:15 PM, Roger Burton West wrote: > On Thu, Nov 17, 2011 at 05:59:27PM +0100, Marcel van Dorp wrote: >> I would like to retrieve the default value from the template, eg. >> TMPL_VAR NAME="VAR1" DEFAULT="DEFAULTVALUE1" > > My extension module, HTML::Template::Set, allows you to do > > <tmpl_set name="var1" value="defaultvalue1"> > > and retrieve this through the query interface. If this would be useful, > let me know and I'll email you a copy. It predates the default= setting, > and doesn't interact with it at all. I've found it on cpan. It does do some I need, but it only does global vars. I would rather have the variables in scope with the LOOPs, so i can use a different filter inside each loop. Any chance this will be implemented soon? I can work around with SET names related to LOOP names, but that is ugly. Anyway, thanks for the responses. Marcel > > Roger > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Roger B. W. <ro...@fi...> - 2011-11-17 20:15:11
|
On Thu, Nov 17, 2011 at 05:59:27PM +0100, Marcel van Dorp wrote: >I would like to retrieve the default value from the template, eg. >TMPL_VAR NAME="VAR1" DEFAULT="DEFAULTVALUE1" My extension module, HTML::Template::Set, allows you to do <tmpl_set name="var1" value="defaultvalue1"> and retrieve this through the query interface. If this would be useful, let me know and I'll email you a copy. It predates the default= setting, and doesn't interact with it at all. Roger |
From: Michael P. <mp...@pl...> - 2011-11-17 20:09:58
|
On 11/17/2011 03:03 PM, Mathew Robertson wrote: > I think you have misunderstand what H::T is used for -> you put data > into the template, not pull data out. This isn't strictly true. The query() interface of H::T is very useful, especially if you are creating template-driven applications (we have lots of applications where users can edit their templates and we fill them with data depending on which variables they use). One of my goals for future H::T development is to make query() more useful so that it can pull more info from the templates. But for now Marcel, I'm afraid that this isn't possible. -- Michael Peters Plus Three, LP |
From: Mathew R. <mat...@gm...> - 2011-11-17 20:03:26
|
Hi Marcel, I think you have misunderstand what H::T is used for -> you put data into the template, not pull data out. In this case, DEFAULT is used when you put in VAR1, and it happens to be undef. cheers, Mathew Robertson On 18 November 2011 03:59, Marcel van Dorp <ma...@va...> wrote: > Hi list, > > I'm new here, so please be kind. > > I would like to retrieve the default value from the template, eg. > > TMPL_VAR NAME="VAR1" DEFAULT="DEFAULTVALUE1" > > I would like to process this value, but > > my $value = $tpl->param('VAR1'); > > does not give me the value "DEFAULTVALUE1" > > I cannot find another way to get the value eg: $tpl->query > > > Basically I would like to write a sub, which retrieves an LDAP filter > from the template, and fills the template with the values retrieved. The > TMPL_VAR name should be the same as the attribute name. With multiple > value attributes you will need a TMPL_LOOP (otherwise you only get the > first value). > > This would greatly simplify my code, as I fill lots of templates with > different LDAP filters. > > (as a sidenote: this should not be too difficult to extend to SQL > queries as well). > > I can achieve this with hidden form fields, but I do not want or need > the info in the (HTML) output. Also I will lose the scoping of the > variables, which is in fact very convenient. > > > Another approach is to add eg. TMPL_PARAM, but I am not that good a > programmer that I can extend a module like HTML::Template > > Can anyone help? > > > Marcel > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > |
From: Marcel v. D. <ma...@va...> - 2011-11-17 17:29:52
|
Hi list, I'm new here, so please be kind. I would like to retrieve the default value from the template, eg. TMPL_VAR NAME="VAR1" DEFAULT="DEFAULTVALUE1" I would like to process this value, but my $value = $tpl->param('VAR1'); does not give me the value "DEFAULTVALUE1" I cannot find another way to get the value eg: $tpl->query Basically I would like to write a sub, which retrieves an LDAP filter from the template, and fills the template with the values retrieved. The TMPL_VAR name should be the same as the attribute name. With multiple value attributes you will need a TMPL_LOOP (otherwise you only get the first value). This would greatly simplify my code, as I fill lots of templates with different LDAP filters. (as a sidenote: this should not be too difficult to extend to SQL queries as well). I can achieve this with hidden form fields, but I do not want or need the info in the (HTML) output. Also I will lose the scoping of the variables, which is in fact very convenient. Another approach is to add eg. TMPL_PARAM, but I am not that good a programmer that I can extend a module like HTML::Template Can anyone help? Marcel |
From: Lyle <web...@co...> - 2011-09-03 21:18:23
|
On 01/09/2011 01:16, Mark F wrote: > Try htmlhelp.org. They have a forum for general HTML topics. Regarding > the form element, it creates an HTTP POST action which is the common > way to transfer data from the client. There are ways to use javascript > to trigger a form submit. Lookup AJAX, JQuery makes it easy Lyle |
From: Mark F <azf...@gm...> - 2011-09-01 00:17:05
|
Try htmlhelp.org. They have a forum for general HTML topics. Regarding the form element, it creates an HTTP POST action which is the common way to transfer data from the client. There are ways to use javascript to trigger a form submit. On Wed, Aug 31, 2011 at 5:06 PM, Rajeev Prasad <rp....@ya...> wrote: > Hello, > > This is not exactly related to html::template, but i could not find where to > post this question: > > is 'html form' the only way to get data from user? > > <form name..... > > </form> > > can't we use something else? > > thank you. > Rajeev > ------------------------------------------------------------------------------ > Special Offer -- Download ArcSight Logger for FREE! > Finally, a world-class log management solution at an even better > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > download Logger. Secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsisghtdev2dev > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > > |
From: Rajeev P. <rp....@ya...> - 2011-09-01 00:06:27
|
Hello, This is not exactly related to html::template, but i could not find where to post this question: is 'html form' the only way to get data from user? <form name..... > </form> can't we use something else? thank you. Rajeev |
From: Tom K. <to...@tc...> - 2011-08-09 03:01:48
|
I believe that it has to do with the XML parser but I might be wrong. I done several apps with htmltmpl using formatted numbers and never had a problem but, it was with HTML files. Opening the output file with an text editor would confirm if it is the XML parser or the original code. Tom -----Original Message----- From: al...@vi... [mailto:al...@vi...] Sent: Monday, August 08, 2011 7:23 PM To: Tom Kopke Subject: Re: [htmltmpl] How to Keep Trailing 0 in Outuput I've never had a problem with the module changing the format before output. I suspect it's something in the code that populates the array that's evaluating it and removing the trailing zeros. - Alan Tom Kopke <to...@tc...> wrote: >I've heard of this happening in other situations too such as data from >SQL and Oracle. The ugly approach is to add a hard space to create a >string (i.e., something akin to and not just empty quotes with a >space) but, may or may not work. I seem to remember that formatting the >entire number, not just the decimal values did the trick and definitely >the preferred approach. Not sure it will work but not seeing all the >related code makes it impossible to know for sure. > >Tom > >-----Original Message----- >From: Roger Burton West [mailto:ro...@fi...] >Sent: Monday, August 08, 2011 12:07 PM >To: htm...@li... >Subject: Re: [htmltmpl] How to Keep Trailing 0 in Outuput > >On Mon, Aug 08, 2011 at 02:38:42PM +0000, Wei, Alice Ju-Hsuan wrote: > >>The first 5 displayed as it is above, but the 6th one was displayed as >4435.8. How can I keep the print out as it is on html-plate? Here is >what I have in the html-template call: > >There's nothing in HTML::Template that should mess around with values >in this way. Can you supply a minimal test case? (I.e. the fewest >possible lines of code that demonstrate the problem, including >everything that we need to reproduce it.) > >Roger > >----------------------------------------------------------------------- >----- >-- >BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The >must-attend event for mobile developers. Connect with experts. >Get tools for creating Super Apps. See the latest technologies. >Sessions, hands-on labs, demos & much more. Register early & save! >http://p.sf.net/sfu/rim-blackberry-1 >_______________________________________________ >Html-template-users mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/html-template-users > > >----------------------------------------------------------------------- >------- uberSVN's rich system and user administration capabilities and >model configuration take the hassle out of deploying and managing >Subversion and the tools developers use with it. Learn more about >uberSVN and get a free download at: >http://p.sf.net/sfu/wandisco-dev2dev >_______________________________________________ >Html-template-users mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Tom K. <to...@tc...> - 2011-08-08 22:38:48
|
I've heard of this happening in other situations too such as data from SQL and Oracle. The ugly approach is to add a hard space to create a string (i.e., something akin to and not just empty quotes with a space) but, may or may not work. I seem to remember that formatting the entire number, not just the decimal values did the trick and definitely the preferred approach. Not sure it will work but not seeing all the related code makes it impossible to know for sure. Tom -----Original Message----- From: Roger Burton West [mailto:ro...@fi...] Sent: Monday, August 08, 2011 12:07 PM To: htm...@li... Subject: Re: [htmltmpl] How to Keep Trailing 0 in Outuput On Mon, Aug 08, 2011 at 02:38:42PM +0000, Wei, Alice Ju-Hsuan wrote: >The first 5 displayed as it is above, but the 6th one was displayed as 4435.8. How can I keep the print out as it is on html-plate? Here is what I have in the html-template call: There's nothing in HTML::Template that should mess around with values in this way. Can you supply a minimal test case? (I.e. the fewest possible lines of code that demonstrate the problem, including everything that we need to reproduce it.) Roger ---------------------------------------------------------------------------- -- BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Roger B. W. <ro...@fi...> - 2011-08-08 16:38:54
|
On Mon, Aug 08, 2011 at 02:38:42PM +0000, Wei, Alice Ju-Hsuan wrote: >The first 5 displayed as it is above, but the 6th one was displayed as 4435.8. How can I keep the print out as it is on html-plate? Here is what I have in the html-template call: There's nothing in HTML::Template that should mess around with values in this way. Can you supply a minimal test case? (I.e. the fewest possible lines of code that demonstrate the problem, including everything that we need to reproduce it.) Roger |
From: Wei, A. Ju-H. <aj...@in...> - 2011-08-08 14:38:50
|
Hi, Tried to create the output so that it preserves the trailing 0s when I print the result out. It looks like that my perl does just as that. $value=sprintf("%0.2f", $value); Print_log $value. "\n"; However, when I tried to get that to print using the html template, which is currently set to an XML format, the trailing 0 that were in the value from the log files disappeared. Here is the output of what is in the log file 150766.81 84735.48 3704.94 3084.17 7715.67 4435.80 The first 5 displayed as it is above, but the 6th one was displayed as 4435.8. How can I keep the print out as it is on html-plate? Here is what I have in the html-template call: my $main_tmpl = HTML::Template->new(filename => 'xml_generate.xml'); # Find all parms in the template file and fill them with matching global parm values my @parameter_names = $main_tmpl->param(); $main_tmpl->param( total => $total; ); Thanks for your help. Alice |
From: Rajeev P. <rp....@ya...> - 2011-07-04 03:25:02
|
Thx. Mark, do you think i can use HTML::FormHandler for handling forms/validating data etc. and HTML::template for displaying results? and will this be suffice for a small project? currently i am not using any database to store my data files, (i think formhandler needs database backend). in that case i will use your suggestion of cgi::simple. rgds, Rajev ________________________________ From: Mark F <azf...@gm...> To: "htm...@li..." <htm...@li...> Sent: Sunday, July 3, 2011 5:24 PM Subject: Re: [htmltmpl] does this replace CGI module? On Sun, Jul 3, 2011 at 2:52 PM, Rajeev Prasad <rp....@ya...> wrote: > I am new to perl CGI, with so many options, i am confused. does modules like > tt, html::template, mason etc. replace CGI module in perl CGI scripting? Can > someone guide please? is CGI module the only one which can parse the values > coming from FORM input fields? H::T replaces some of the CGI module. The part which emits HTML. That's the benefit of templating. It isolates the HTML for easier maintenance. The CGI module would still be used to obtain post variables, etc. I use CGI::Simple because it doesn't have all the HTML fluff which the CGI module has. I've read it's more efficient due to its smaller size. But, for me it's just principle. I never liked CGI's conflation of CGI and HTML behavior. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Mark F <azf...@gm...> - 2011-07-03 22:24:37
|
On Sun, Jul 3, 2011 at 2:52 PM, Rajeev Prasad <rp....@ya...> wrote: > I am new to perl CGI, with so many options, i am confused. does modules like > tt, html::template, mason etc. replace CGI module in perl CGI scripting? Can > someone guide please? is CGI module the only one which can parse the values > coming from FORM input fields? H::T replaces some of the CGI module. The part which emits HTML. That's the benefit of templating. It isolates the HTML for easier maintenance. The CGI module would still be used to obtain post variables, etc. I use CGI::Simple because it doesn't have all the HTML fluff which the CGI module has. I've read it's more efficient due to its smaller size. But, for me it's just principle. I never liked CGI's conflation of CGI and HTML behavior. |
From: Rajeev P. <rp....@ya...> - 2011-07-03 21:52:12
|
Hello, I am new to perl CGI, with so many options, i am confused. does modules like tt, html::template, mason etc. replace CGI module in perl CGI scripting? Can someone guide please? is CGI module the only one which can parse the values coming from FORM input fields? thank you. Rajeev |
From: David A. B. <dav...@gm...> - 2011-04-30 01:04:15
|
On Fri, Apr 29, 2011 at 16:37, Michael Peters <mp...@pl...> wrote: > On 04/29/2011 05:28 PM, David A. Bandel wrote: > >> my @calloutdata; >> foreach $callskey ( sort {$callnum{$b}<=> $callnum{$a}} keys %callnum){ >> my %outbound; >> $outbound{EXTENNUMCALLED} = $callskey; >> $outbound{TIMESCALLED} = $callnum{$callskey}; >> push( @calloutdata, \%outbound ); >> } >> >> $template->param( OUTBOUNDS => \@calloutdata ); >> >> The calloutdata array winds up to be about 200 lines long. Any way to >> have the TMPL_LOOP stop output after 15 or so table lines? > > Well, the first thing I'd do is suggest that if possible you just don't put > all 200 things into the loop. That would save on your processing if you > didn't have to create the big loop to begin with. Unfortunately, in order to do what I'm doing (you haven't seen the code that comes before), I need all the values all at once or the sort on the value of the key/value pair doesn't work. > > But if you needed them in the loop in some places but didn't want to display > them in others, you can use the __counter__ loop context var combined with > HTML::Template::Expr. It's an idea. But hoping to keep it simple. > > <tmpl_loop outbounds> > <tmpl_if expr="__counter__ <= 15"> > ... > </tmpl_if> > </tmpl_loop> > >> Nothing in the docs suggests a way to do this (or am I missing >> something?). > > It's not possible with just HTML::Template, but HTML::Template::Expr should > help you get there. > > -- > Michael Peters > Plus Three, LP > Will keep this in mind. Thanx, David A. Bandel -- Focus on the dream, not the competition. - Nemesis Air Racing Team motto Visit my web page at: http://david.bandel.us/ |
From: David A. B. <dav...@gm...> - 2011-04-30 01:00:33
|
On Fri, Apr 29, 2011 at 16:45, vij...@gm... <vij...@gm...> wrote: > Just a different way of thinking about it, but you could always output all > the rows and use html/css to hide the ones after #15 or whatever. That way > you're a bit more in keeping with data/presentation split that > HTML::Template enforces... Knew I was missing something. Michael suggested in another post HTML::Template::Expr, but I like the CSS method a little better. Thanx. > > Vijay Krishna Ramesh > vij...@gm... > > ----- Reply message ----- > From: "David A. Bandel" <dav...@gm...> > Date: Fri, Apr 29, 2011 17:28 > Subject: [htmltmpl] TMPL_LOOP limit or count > To: <htm...@li...> > > Folks, > > Been using HTML::Template in a few projects. Really nice not to have > HTML tangled in the Perl code. > > Got a largish hash I am sorting. Want to output only about 15 lines > of the table. Is there a way to tell the loop to stop? > > Here's what I'm doing: > > my @calloutdata; > foreach $callskey ( sort {$callnum{$b} <=> $callnum{$a}} keys %callnum){ > my %outbound; > $outbound{EXTENNUMCALLED} = $callskey; > $outbound{TIMESCALLED} = $callnum{$callskey}; > push( @calloutdata, \%outbound ); > } > > $template->param( OUTBOUNDS => \@calloutdata ); > > The calloutdata array winds up to be about 200 lines long. Any way to > have the TMPL_LOOP stop output after 15 or so table lines? > > Nothing in the docs suggests a way to do this (or am I missing something?). > [snip] David A. Bandel -- Focus on the dream, not the competition. - Nemesis Air Racing Team motto Visit my web page at: http://david.bandel.us/ |