/**
  * Processes a file
  *
  * @param string      $uPath         file path
  * @param string      $uFileContents contents of file
  * @param TokenStream $uTokenStream  extracted tokens wrapped with tokenstream
  *
  * @return void
  */
 public function processFile($uPath, $uFileContents, TokenStream $uTokenStream)
 {
     $tViewEngine = Views::findViewEngine($uPath);
     if ($tViewEngine === null) {
         return;
     }
     // TODO compile view
     $tViewEngineClass = get_class($tViewEngine);
     echo sprintf("View %s => %s\n", $uPath, $tViewEngineClass);
 }
Beispiel #2
0
 /**
  * Renders a view
  *
  * @param string $uView       view file
  * @param mixed  $uModel      view model
  * @param mixed  $uController controller instance
  *
  * @return void
  */
 public function view($uView, $uModel = null, $uController = null)
 {
     if ($uModel === null) {
         $uModel = $this->vars->toArray();
     }
     if (strncmp($uView, "\\", 1) === 0) {
         Views::viewFile($uView, $uModel, $this);
     } else {
         $tNamespace = $this->application->config["modules"][$this->routeInfo["module"]]["namespace"];
         Views::viewFile("{$tNamespace}\\Views\\{$uView}", $uModel, $this);
     }
 }