Beispiel #1
0
 public static function getInstance()
 {
     if (!self::$instancia instanceof self) {
         self::$instancia = new self();
     }
     return self::$instancia;
 }
Beispiel #2
0
 public function endTableRow()
 {
     $valores = array('config.seccion' => 'pie');
     $this->api->component('table_row', $valores);
 }
Beispiel #3
0
 /**
  * Ejecuta un componente incluyendo el archivo .php
  * Primero asegura que este exista, si no existe le pide a la API que lo traiga del servidor
  * @param string $name
  * @param array $valores
  */
 public function component($name, $valores)
 {
     $nameComponent = $this->api->project . '_' . $name;
     if (!file_exists($this->api->pathComponent . $nameComponent . '.php')) {
         try {
             $code = $this->api->createComponent($name);
             $file = fopen($this->api->pathComponent . $nameComponent . '.php', 'x');
             fwrite($file, $code);
             fclose($file);
         } catch (\Exception $e) {
             echo 'Error loading component: ' . $name;
             return;
         }
     }
     //Lo incluyo y se ejecuta solo
     include $this->api->pathComponent . $nameComponent . '.php';
 }
Beispiel #4
0
 public static function endTableRow()
 {
     $api = ApiUi::getInstance();
     $valores = array('config.seccion' => 'pie');
     $api->componente('table_row', $valores);
 }