サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
CES 2025
template-toolkit.org
BackHello, I'm a talking badger. UpMy name is Meles Meles, but you can call me "Badger". NextAbout the Template Toolkit The Badger Book The Template Toolkit is a fast, flexible and highly extensible template processing system. It is Free (in both senses: free beer and free speech), Open Source software and runs on virtually every modern operating system known to man. It is mature, reliable and wel
BackYou can't go back. Would you like to come foraging for nuts and berries in the forest with me instead? UpTemplate Toolkit Documentation NextTemplate::ModulesTemplate Toolkit Modules
The Template Toolkit is a collection of Perl modules which implement a fast, flexible, powerful and extensible template processing system. It is "input-agnostic" and can be used equally well for processing any kind of text documents: HTML, XML, CSS, Javascript, Perl code, plain text, and so on. However, it is most often used for generating static and dynamic web content, so that's what we'll focus
Template::Manual::Variables Template variables and code bindings http://template-toolkit.org/docs/manual/Variables.html A reference to a hash array may be passed as the second argument to the process() method, containing definitions of template variables. The VARIABLES (a.k.a. PRE_DEFINE) option can also be used to pre-define variables for all templates processed by the object. my $tt = Template->
The GET directive retrieves and outputs the value of the named variable. [% GET foo %] The GET keyword is optional. A variable can be specified in a directive tag by itself. [% foo %] The variable can have an unlimited number of elements, each separated by a dot. Each element can have arguments specified within parentheses. [% foo %] [% bar.baz %] [% biz.baz(10) %] ...etc... See Template::Manual::
The format filter takes a format string as a parameter (as per printf()) and formats each line of text accordingly. [% FILTER format('<!-- %-40s -->') %] This is a block of text filtered through the above format. [% END %] Output: <!-- This is a block of text filtered --> <!-- through the above format. -->
Splits the value into a list of chunks of a certain size. [% ccard_no = "1234567824683579"; ccard_no.chunk(4).join %] Output: 1234 5678 2468 3579 If the size is specified as a negative number then the text will be chunked from right-to-left. This gives the correct grouping for numbers, for example. [% number = 1234567; number.chunk(-3).join(',') %] Output: 1,234,567 Returns the text with any leadi
このページを最初にブックマークしてみませんか?
『Template Toolkit Home Page』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く