Example #1
0
 /**
  * @return string
  */
 public function render()
 {
     if (!$this->layout) {
         CLog::getInstance()->_error('[' . __CLASS__ . '] Layout file not selected!');
         mfe::stop(0xe3);
     }
     ob_start(function ($layout) {
         return preg_replace_callback('#\\{([a-z0-9\\-_\\#]*?)\\}#Ssi', function ($match) {
             return isset($this->{substr($match[0], 1, -1)}) ? $this->{substr($match[0], 1, -1)} : $match[0];
         }, $layout);
     });
     if (!$this->loadLayout()) {
         CLog::getInstance()->_error('[' . __CLASS__ . '] Not found layout file: ' . $this->layout . $this->layout_extension . ' in directories: ' . PHP_EOL . implode('; ' . PHP_EOL, mfe::app()->loader->getRealPaths('@engine.@layout.', true)));
         mfe::stop(0xe3);
     }
     $this->result = ob_get_contents();
     ob_clean();
     return $this->result;
 }
Example #2
0
 public static function errorHandler($error_number, $error_string, $error_file, $error_line)
 {
     CLog::getInstance()->_error($error_string . ' in ' . $error_file . ' on line ' . $error_line);
     return CDebug::errorHandler([$error_number, $error_string, $error_file, $error_line]);
 }