CQT

関数

h($text, $charset = 'UTF-8')

$textをサニタイズします。htmlspecialcharsのラッパーです。

compile($template, $replace, $prefix = '{{{ ', $suffix = ' }}}')

$template内の{{{ key }}}を$replaceで置き換えます。

サンプル
  1.  
  2.  <?php
  3.  $template = '
  4.  <h4>{{{ title }}}</h4>
  5.  <p>{{{ comment }}}</p>
  6.  ';
  7.  
  8.  $replace = array(
  9.   'title' => 'CQT::compile()',
  10.   'comment' => 'template内の{{{ comment }}}を置き換えます。'
  11.  );
  12.  
  13.  echo CQT::compile($template, $replace);
  14.  ?>
実行結果

CQT::compile()

template内の{{{ comment }}}を置き換えます。

source($string, $type = 'PHP', $title = null)