Esempio n. 1
0
 /**
  * Create a snippet function for the fragment selected from
  * the specified file.  The return value is then callable with some
  * data than the $handler expects.  The handler then needs to
  * return an array of selector/transformer key values pairs
  *
  * @param string $path
  * @param string $selector
  * @param Callable $handler Optional
  *
  * @return Callable
  */
 public static function snippet($path, $selector, $handler = null)
 {
     return function () use($path, $selector, $handler) {
         $args = func_get_args();
         return Template::fetch($path, $handler ? call_user_func_array($handler, $args) : array(), $selector);
     };
 }
Esempio n. 2
0
 public function testTransformersAreOptionalToHtmlMethod()
 {
     $t = new T($this->p);
     $this->assertNotNull($t->html());
 }