function preGenerate($code)
 {
     if ($this->include_file) {
         $code->registerInclude($this->include_file);
     }
     parent::preGenerate($code);
 }
Exemple #2
0
 function preGenerate($code)
 {
     parent::preGenerate($code);
     $code->registerInclude('limb/i18n/src/charset/driver.inc.php');
     $value = $this->base->getValue();
     if (count($this->params) > 2) {
         $this->suffix_var = $code->generateVar();
         $limit = $this->params[0];
         $offset = $this->params[1];
         $code->writePhp("{$this->suffix_var} = '';\n");
         $code->writePhp("if(lmb_strlen({$value}) > ({$limit} + {$offset})) {$this->suffix_var} = " . $this->params[2] . ";\n");
     }
     if (count($this->params) > 3) {
         $this->chunk_var = $code->generateVar();
         $code->writePhp($this->chunk_var . ' = lmb_substr(' . $value . ',' . $this->params[1] . ',' . $this->params[0] . ');');
     }
 }
Exemple #3
0
 function preGenerate($code)
 {
     $code->registerInclude('limb/i18n/src/macro/filters.inc.php');
     parent::preGenerate($code);
 }