private function TemplateContent() { $areaCodes = ''; $writer = new Writer(); $this->InitAreas(); $template = PathUtil::CodeTemplate($this->MyBundle(), 'Layout.phtml'); $templateCode = File::GetContents($template); $indent = $this->GetIndent($templateCode, '_{areas}_'); for ($idx = 0; $idx < count($this->areaNames); ++$idx) { $name = $this->areaNames[$idx]; $writer->StartPhpInline(); $writer->AddCommandInline('echo $this->RenderArea(\'' . $name . '\')'); if ($idx < count($this->areaNames) - 1) { $writer->EndPhp(); } else { $writer->EndPhpInline(); } if ($idx > 0) { $areaCodes .= $indent; } $areaCodes .= $writer->Flush(); } return str_replace('_{areas}_', $areaCodes, $templateCode); }