Ejemplo n.º 1
0
 function render($indent = 0, $doIndent = true)
 {
     $data = H\Text::varToCode(array("base" => $this->baseType, "type" => $this->type, "opt" => $this->opt, "source" => $this->source, "content" => $this->content));
     $out = "<?php " . $this->varname . "={$data}; echo Hamle\\Tag\\DynHtml::toStTag(" . $this->varname . ",\$form).";
     $out .= "implode(\"\\n\"," . $this->varname . "['content']).";
     $out .= "Hamle\\Tag\\DynHtml::toEnTag(" . $this->varname . ",\$form)?>\n";
     return $out;
 }
Ejemplo n.º 2
0
 function toPHP()
 {
     if (is_numeric($this->scope)) {
         return "Hamle\\Scope::get(" . Text::varToCode($this->scope) . ")";
     } else {
         return "Hamle\\Scope::getName(" . Text::varToCode($this->scope) . ")";
     }
 }
Ejemplo n.º 3
0
 /**
  * Return as PHP Code
  * @return string
  */
 function toPHP()
 {
     $limit = Hamle\Text::varToCode($this->sortlimit['sort']) . "," . $this->sortlimit['limit'] . "," . $this->sortlimit['offset'] . "," . $this->grouptype['grouptype'];
     $sub = $this->sub ? "->" . $this->sub->toPHP() : "";
     return "hamleRel(" . $this->dir . "," . Hamle\Text::varToCode($this->filt['tag']) . ",{$limit}){$sub}";
 }
Ejemplo n.º 4
0
 function toPHPVar()
 {
     return "Hamle\\Scope::get()->hamleGet(" . Text::varToCode($this->var) . ")";
 }
Ejemplo n.º 5
0
 function toPHP()
 {
     return '$form->getField(' . Text::varToCode($this->var) . ')->getValue()';
 }
Ejemplo n.º 6
0
 /**
  * @return string PHP Code
  */
 function toPHP()
 {
     $sub = $this->sub ? "->" . $this->sub->toPHP() : "";
     if ($this->scope instanceof Scope) {
         return $this->scope->toPHP() . $sub;
     } elseif ($this->scope === true) {
         return "Hamle\\Scope::get(0){$sub}";
     }
     $limit = Text::varToCode($this->sortlimit['sort']) . "," . $this->sortlimit['limit'] . "," . $this->sortlimit['offset'];
     if (count($this->filt['tag'])) {
         return "Hamle\\Run::modelTypeTags(" . Text::varToCode($this->filt['tag']) . ",{$limit}){$sub}";
     }
     if (count($this->filt['id'])) {
         if (isset($this->filt['id']['*']) && count($this->filt['id']['*']) == 1) {
             return "Hamle\\Run::modelId(" . Text::varToCode(current($this->filt['id']['*'])) . ",{$limit}){$sub}";
         } else {
             return "Hamle\\Run::modelTypeId(" . Text::varToCode($this->filt['id']) . ",{$limit}){$sub}";
         }
     }
     return "";
 }