public function hello_doe($request, $match) { $parms = array('name' => urldecode($match[1])); return shortcuts\Template::RenderToResponse('hello.html', $parms, $request); }
/** * Like previous function, but with i18n support. * It's allow to serve static content build with the template engine. * The first variable part of the url must be the language code. * /[en|fr|de]/home * /[en|fr|de]/contacts */ public function simpleWithLocale($request, $match, $template) { Translation::setLocale(strtolower($match[1])); return shortcuts\Template::RenderToResponse($template, array(), $request); }
public function testModifier() { $str = Template::RenderToString('tmpl-modifier.html', array('mdtext' => '#A h1 title')); $this->assertEquals(trim($str), '<h1>A h1 title</h1>'); }