Class: TemplateEngine

at.pkgs. TemplateEngine

テンプレートエンジンクラス. チュートリアル: at.pkgs.Template

new TemplateEngine(instance)

Parameters:
Name Type Argument Description
instance at.pkgs.TemplateEngine <optional>

インスタンス.

Since:
  • 0.1.4
Source:

Extends

Members

<static> instance :at.pkgs.TemplateEngine

デフォルトテンプレートエンジンインスタンス.

本インスタンスの各メソッドを上書きすることでat.pkgs.template()の振舞いを変更可能.

Type:
Since:
  • 0.1.4
Source:

<readonly> parent :Object

親クラスのプロトタイプへの参照.

Type:
  • Object
Since:
  • 0.1.3
Inherited From:
Source:

pattern :RegExp

テンプレートデリミタパターン.

/スクリプトブロックパターン|エスケープ出力ブロックパターン|直接出力ブロックパターン|$/g形式

インスタンスの本メソッドを上書きすることでデリミタを変更可能.

Type:
  • RegExp
Since:
  • 0.1.4
Source:

<readonly> self :Function

コンストラクタへの参照.

Type:
  • Function
Since:
  • 0.1.0
Inherited From:
Source:

Methods

escape(source) → {String}

エスケープ関数.

インスタンスの本メソッドを上書きすることでエスケープ処理を変更可能.

Parameters:
Name Type Description
source *

エスケープ対象.

Since:
  • 0.1.4
Source:
Returns:

エスケープ済文字列.

Type
String

immediate() → {Boolean}

指定された名称のプロパティを直接持つか取得する.

Parameters:
Name Type Description
プロパティ名. String
Since:
  • 0.1.5
Inherited From:
Source:
Returns:

持つならばtrue.

Type
Boolean

prepare(source) → {at.pkgs.TemplateEngine~Renderer}

テンプレートソースを処理しテンプレート実行関数を生成する.

Parameters:
Name Type Description
source String

テンプレートソース.

Since:
  • 0.1.4
Source:
Returns:

テンプレート実行関数.

Type
at.pkgs.TemplateEngine~Renderer

raw(source) → {String}

直接出力関数.

インスタンスの本メソッドを上書きすることで直接出力処理を変更可能.

Parameters:
Name Type Description
source *

対象.

Since:
  • 0.1.4
Source:
Returns:

文字列.

Type
String

Type Definitions

Renderer(data) → {String}

Parameters:
Name Type Description
data Object

テンプレートパラメタ.

Since:
  • 0.1.4
Source:
Returns:

出力文字列.

Type
String
Copyright (c) 2009-2014, Architector Inc., Japan.
Documentation generated by JSDoc 3.2.0 on Tue Aug 26 2014 22:27:18 GMT+0900 (JST) using the DocStrap template.