function t($tmpl, $default = null) { $blank = $this->blank(); if (!$blank || !is_null($default)) { if ($blank) { $value = $default; } else { $value = $this->__toString(); } if (!preg_match("/\{\{.+\}\}/", $tmpl)) { // assume we want the value in the innermost tag WOOF::incl_phpquery(); phpQuery::newDocumentHTML('<div class="context"></div>', $charset = 'utf-8'); pq($tmpl)->appendTo(".context"); pq("*:only-child:last")->append("{{val}}"); $tmpl = pq(".context")->html(); } return WOOF::render_template($tmpl, array("value" => $value, "val" => $value) ); } return ""; }