/** * Compile the tag data and return result * * @return string Compiled result of the tag wrapper */ public function compile() { $php = ''; if (!($injectAreaName = $this->parameter->get('name'))) { throw new Exception\InjectNameNotSpecified(); return $php; } $wrapper = explode('(CODE)', $this->data, 2); $wrapperBefore = isset($wrapper[0]) ? $wrapper[0] : ''; $wrapperAfter = isset($wrapper[1]) ? $wrapper[1] : ''; if (isset($this->pool['Injected'][$injectAreaName]) && !empty($this->pool['Injected'][$injectAreaName])) { foreach ($this->pool['Injected'][$injectAreaName] as $injected) { $php .= $wrapperBefore . Compiler::compile($this->pool, $injected)->result() . $wrapperAfter; } } elseif (isset($this->middles['empty'])) { foreach ($this->middles['empty'] as $empty) { $php .= $empty; } } return $php; }
/** * Compile the tag data and return result * * @return string Compiled result of the tag wrapper */ public function compile() { $templateContent = $compiler = ''; $sets = $this->getSetTo($this->mainParameter); if (!($templateName = $this->mainParameter->get('name'))) { throw new Exception\TemplateNameNotSpecified(); return $compiler; } if (!isset($this->pool['File']['Tpl'][$templateName]['default'])) { throw new Exception\TemplateNotFound($templateName); return $compiler; } $templateContent = str_replace(array_keys($sets), array_values($sets), file_get_contents($this->pool['File']['Tpl'][$templateName]['default'])); $compiler = Compiler::compile($this->pool, $templateContent); return $compiler->result(); }
/** * Compile the tag data and return result * * @return string Compiled result of the tag wrapper */ public function compile() { if (!isset($this->pool['LanguageMap'][$this->langCode])) { throw new Exception\LanguageCodeNotFound($this->langCode); } return Compiler::compile($this->pool, $this->pool['LanguageMap'][$this->langCode])->result(); }