Exemplo n.º 1
0
 /**
  * Calls the parent getComponentRefCode() method and writes it to the
  * compiled template, appending an addChild() method used to create
  * this component at runtime
  */
 function generateConstructor($code_writer)
 {
     $this->generateUniqueId($code_writer);
     if ($this->runtimeIncludeFile) {
         $code_writer->registerInclude($this->runtimeIncludeFile);
     }
     $code_writer->writePHP($this->unique_var . ' = new ' . $this->runtimeComponentName . '(\'' . $this->getServerId() . '\');' . "\n");
     $code_writer->writePHP($this->getComponentRefCode() . ' = ' . $this->unique_var . ';' . "\n");
     $code_writer->writePHP($this->parent->getComponentRefCode() . '->addChild(' . $this->unique_var . ');' . "\n");
     parent::generateConstructor($code_writer);
 }