Example #1
0
 /**
  * render.
  *
  * @param   callable Callback
  *
  * @return string rendered output
  */
 public function render($__local281291callbackFilter = null)
 {
     $this->directory = Application::realpath() . '/Views';
     $__local281291vars = array_merge(self::$data, $this->vars);
     $__local281291fileparts = array_filter(explode('/', $this->filename), 'trim');
     $__local281291filename = $this->directory . '/' . implode('/', $__local281291fileparts) . '.php';
     if (!is_file($__local281291filename)) {
         throw new Exception('Unable to locate view : ' . $__local281291filename);
     }
     $__local281291contentFile = $this->loadContentFile($__local281291filename);
     extract($__local281291vars);
     ob_start();
     eval('?>' . $__local281291contentFile);
     $__local281291outputRendering = ob_get_clean();
     $__local281291trimOutputRendering = trim($__local281291outputRendering);
     return is_callable($__local281291callbackFilter) ? call_user_func($__local281291callbackFilter, $__local281291trimOutputRendering, $this) : $__local281291trimOutputRendering;
 }