Пример #1
0
 /**
  * fromArrayPrefixed - takes a multi dimensional array, and builds the 'xxx[sss][xx]' => value
  * 
  * @param   array   key(tag name) => value   
  * @param   array   key(tag name) => value   
  * @param   optional array   key(tag name) => HTML_Element
  *
  * @return   array    Array of HTML_Elements
  * @access   public
  */
 function fromArrayPrefixed($prefix, $ar, $ret = array())
 {
     foreach ($ar as $k => $v) {
         if (is_array($v)) {
             $ret = HTML_Template_Flexy_Factory::fromArrayPrefixed($prefix . '[' . $k . ']', $v, $ret);
             if (!isset($ret[$prefix . '[' . $k . '][]'])) {
                 $ret[$prefix . '[' . $k . '][]'] = new HTML_Template_Flexy_Element();
             }
             $ret[$prefix . '[' . $k . '][]']->setValue($v);
         }
         if (!isset($ret[$prefix . '[' . $k . ']'])) {
             $ret[$prefix . '[' . $k . ']'] = new HTML_Template_Flexy_Element();
         }
         $ret[$prefix . '[' . $k . ']']->setValue($v);
     }
     return $ret;
 }
Пример #2
0
 function outputBody()
 {
     if ($this->timer) {
         $this->timer->setMarker(__CLASS__ . '::outputBody - start');
     }
     $ff = HTML_FlexyFramework::get();
     $proj = $ff->project;
     // DB_DataObject::debugLevel(1);
     $m = DB_DAtaObject::factory('Builder_modules');
     $m->get('name', $proj);
     //var_dump($m->path);exit;
     // needs to modify the template directory??
     // use the builder_module == app name
     // look for part with same name.
     if (empty($ff->Pman_Builder['from_filesystem'])) {
         $template_engine = new HTML_Template_Flexy(array('templateDir' => $m->path));
     } else {
         $template_engine = new HTML_Template_Flexy();
     }
     $template_engine->debug = 1;
     //print_R($template_engine);
     $template_engine->compile($this->template);
     if ($this->elements) {
         /* BC crap! */
         $this->elements = HTML_Template_Flexy_Factory::setErrors($this->elements, $this->errors);
     }
     $template_engine->elements = $this->elements;
     if ($this->timer) {
         $this->timer->setMarker(__CLASS__ . '::outputBody - render template');
     }
     //DB_DataObject::debugLevel(1);
     $template_engine->outputObject($this, $this->elements);
     if ($this->timer) {
         $this->timer->setMarker(__CLASS__ . '::outputBody - end');
     }
 }
Пример #3
0
 /**
  * The body Output layer.
  * 
  * compiles the template
  * At present there is no caching in here..  - this may change latter..
  * 
  * used by putting {outputBody} in the main template.
  * @access   public
  */
 function outputBody()
 {
     $template_engine = new HTML_Template_Flexy();
     $template_engine->compile($this->template);
     if ($this->elements) {
         /* BC crap! */
         $this->elements = HTML_Template_Flexy_Factory::setErrors($this->elements, $this->errors);
     }
     $template_engine->elements = $this->elements;
     $template_engine->outputObject($this, $this->elements);
 }