/**
  * Draw a part by passing a key/value array where the keys match the
  * part's input variable names.
  * 
  * @param string The name of the part template.
  * @param array Key/values according to part's input(s).
  * @return boolean True if successful, throws exception if unsuccessful.
  */
 public static function draw($templateName = '', $context = array())
 {
     if ($templateName === '') {
         throw new RecessFrameworkException("First parameter 'partPath' must not be empty.", 1);
     }
     $body = self::body($templateName);
     $template = new JsonTemplate($body);
     return $template->expand($context);
 }
Esempio n. 2
0
 function expand($template_str, $data, $options = array())
 {
     $t = new JsonTemplate($template_str, $options);
     return $t->expand($data);
 }