Exemple #1
0
 /**
  * Creates the initial document (root) of the page object and loads the initial template. If
  * no context was set before, the namespace of the initial template is taken instead.
  *
  * @param string $namespace namespace if the initial template
  * @param string $design (file)name if the initial template
  *
  * @author Christian Schäfer
  * @version
  * Version 0.1, 28.12.2006<br />
  * Version 0.2, 31.01.2007 (Now the context of the document is set)<br />
  * Version 0.3, 04.03.2007 (The namespace is taken as a context, if no other was set before)<br />
  * Version 0.4, 22.04.2007 (Now the language is applied to the document)<br />
  * Version 0.5, 08.03.2009 (Bug-fix: protected variable parentObject might not be used)<br />
  * Version 0.6, 27.06.2014 (Bug fix: ensure native environment for Document to allow expression-style place holders)<br />
  */
 public function loadDesign($namespace, $design)
 {
     $this->document = new Document();
     // set the current context
     $context = $this->getContext();
     if (empty($context)) {
         $this->document->setContext($namespace);
     } else {
         $this->document->setContext($context);
     }
     // set the current language
     $this->document->setLanguage($this->getLanguage());
     // load the design
     $this->document->setObjectId(XmlParser::generateUniqID());
     $this->document->loadDesign($namespace, $design);
     // ensure native APF environment
     $this->document->onParseTime();
     $this->document->onAfterAppend();
 }