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:
テンプレート実行関数.
-
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