Esempio n. 1
0
 public function hello_doe($request, $match)
 {
     $parms = array('name' => urldecode($match[1]));
     return shortcuts\Template::RenderToResponse('hello.html', $parms, $request);
 }
Esempio n. 2
0
 /**
  * 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);
 }
Esempio n. 3
0
 public function testModifier()
 {
     $str = Template::RenderToString('tmpl-modifier.html', array('mdtext' => '#A h1 title'));
     $this->assertEquals(trim($str), '<h1>A h1 title</h1>');
 }