public function write($str, $context = []) { if (count($context) === 0) { echo $str; } else { $replaces = []; foreach ($context as $k => $v) { $replaces[':' . $k] = $v; } echo strtr($str, $replaces); } return $this; }