示例#1
0
文件: Views.php 项目: photon/photon
 public function hello_doe($request, $match)
 {
     $parms = array('name' => urldecode($match[1]));
     return shortcuts\Template::RenderToResponse('hello.html', $parms, $request);
 }
示例#2
0
文件: views.php 项目: photon/photon
 /**
  * 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);
 }
示例#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>');
 }