You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
TTの本体を差し替える 前回はウェブ業界で標準的に使われているTemplate Toolkitをより安全に使うためのカスタマイズ方法をいくつか紹介しました。しばしば批判の対象となってきたエスケープの問題については、TTでも適切な拡張を施せば後発のモジュールと遜色ないか、それ以上に便利に使えることは確認できたかと思います。 ただし、エスケープの仕方ひとつとってもさまざまなやり方があったように、TTは、柔軟である代償として速度面ではかなりの不利を抱えています。 もっとも、不利といってもそれはいまの、しかもかなり規模の大きな現場の視点で見たときの話で、数年前、おもなライバルがHTML::Mason(と、機能面で大きな差があるHTML::Template)だった時代にはTTも十分に高速といえましたし[1]、中小規模のサイトではいまでもTTで十分なレスポンスは得られます。 また、かれこれ10年近く
モダンPerlの世界へようこそ 第40回Text::MicroTemplate:得意分野なんだからPerlを使えばいいじゃない、という方に テキストの整形はPerlの基本 Perlは「Practical Extraction and Report Language」とも呼ばれるくらいで、正規表現などによる情報抽出機能と並んで、レポートの形を整えて出力する機能はPerlの根幹をなす部分といえます。もちろんそのもっとも原始的な形は二重引用符でくくられた文字列のなかにそのまま変数を埋め込むものです。 print "This report is created by $author."; もう少しこったことをしたければ、Cから受け継いだprintf系の構文を使えばよいでしょう。 printf "This report is created on %04d/%02d/%02d.", $year, $
Perlのテンプレートエンジンでのテンプレートのコンパイル方法をまとめて見る。 なんというかなんとなくまとめてみた。 やり方がわかったのは Template Toolkit Mojo::Template Text::MicroMason の三つ。 HTML::Template HTML::Mason はコンパイル方法が見つけられなかった。 なんというか、HTML::Templateはどうもなさそうで、 HTML::Masonは多分方法があるんだろうけど良く分からないって言う。 で、以下やり方。 Template Toolkit use Template; my $tt = Template->new; my $compiled = $tt->context->template( $source ); Mojo::Template use Mojo::Template; my $mt = M
PerlのHTML::Templateモジュールって、hashrefのarrayrefしか扱えないのでしょうか。以下に例を示します。サンプル1はよいのだけれど、サンプル2はどうテンプレートを書けばよいか、という話題です。サンプル2はhashrefのhashrefですね。もしどなたか情報があればご教示ください。 サンプル1: (これはOK) use strict; use warnings; use HTML::Template; my $data1 = [ { NAME => 'Alice', AGE => 23 }, { NAME => 'Bobby', AGE => 18 }, { NAME => 'Chris', AGE => 17 }, ]; my $t = HTML::Template->new( scalarref => \<<'EOD', <TMPL_LOOP NAME=US
Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at
はじめに BlogなどのCMSでは複数のページのデザインを統一したり、一度に変換したりできます。 静的なHTMLであってもCSSを利用すればデザインの統一ができます。 ここでは静的なHTMLで、デザインの統一をするツールを紹介します。 やりたいことは例えば「どのページにも同じメニューバーをつけたい」とか、 「どのページにも同じ著作権表示を入れたい」とかです。 解のひとつはWiki記法のようなものです。 テキストファイルを読み込んで、HTMLに変換します。 確かにこれは便利ですが、どうせHTMLに変換するのだから、 最初からHTMLで書けばいい、という気もします。 そこでこの文書では、もっと単純に、 (不完全な)HTMLにテンプレートを組み込んでHTMLを合成してしまいます。 ついでにHTMLの文法チェックもしますが、 Another HTML-lint のような高機能なものではありません。
Open Source Website Templates brings you some of the best designers to showcase their free website template designs. Our Mission at Open Source Website Templates is to provide the highest quality, carefully selected free CSS and XHTML web templates available for your use. We encourage the use of our templates for business, personal, and non-profit websites. Because of our love for the environment
Advanced HTML::Template: Filters Nov 30, 2006 by Philipp Janert The CPAN module HTML::Template is a very simple, yet extremely useful module to achieve true separation of presentation and logic when programming CGI scripts. The basic idea is that, rather than having print statements scattered all through your code (the “classic” CGI approach), or mixing logic in with HTML (as in JSP, ASP, and Perl
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く