src/bbn/mvc/view.php
public function get(array $data=null)
	{
		if ( $this->check() ){
			if ( \is_null($this->content) ){
				$this->content = file_get_contents($this->file);
			}
			if ( empty($this->content) ){
				return '';
			}
			if ( $this->checkers ){
			  $st = '';
			  foreach ( $this->checkers as $chk ){
			    $st .= file_get_contents($chk);
        }
        $this->content = $st.$this->content;
      }
      switch ( $this->ext ){
        case 'js':
          // Language variables inclusions in the javascript files
          if ( !empty($this->lang_file) ){
            $tmp = json_decode(file_get_contents($this->lang_file), true);
            $path = $this->plugin ? substr($this->path, \strlen($this->plugin) + 1) : $this->path;
            //die(var_dump(count($tmp), 'components/'.$this->path.'/'.$this->path, $tmp));
            if ( $translations = $tmp['mvc/'.$path] ?? ($tmp['components/'.$path] ?? null) ){
              $json = json_encode($translations);
              $tmp = <<<JAVASCRIPT
(data) => {
  bbn.fn.autoExtend("lng", $json)
};
JAVASCRIPT;
              $this->content = $tmp.$this->content;
            }
            unset($tmp, $translations);
          }
					return $this->content;
        case 'coffee':
					return $this->content;
        case 'css':
					return $this->content;
        case 'less':
			    $less = new \lessc();
          return $less->compile($this->content);
        case 'scss':
          $scss = new \Leafo\ScssPhp\Compiler();
					return $scss->compile($this->content);
				case 'html':
					return empty($data) ? $this->content : bbn\tpl::render($this->content, $data);
        case 'php':
          $dir = getcwd();
          chdir(dirname($this->file));
          $r = bbn\mvc::include_php_view($this->file, $this->content, $data ?: []);
          chdir($dir);
          return $r;
      }
		}
		return false;
	}
public function get(array $data=null)
	{
		if ( $this->check() ){
			if ( \is_null($this->content) ){
				$this->content = file_get_contents($this->file);
			}
			if ( empty($this->content) ){
				return '';
			}
			if ( $this->checkers ){
			  $st = '';
			  foreach ( $this->checkers as $chk ){
			    $st .= file_get_contents($chk);
        }
        $this->content = $st.$this->content;
      }
      switch ( $this->ext ){
        case 'js':
          // Language variables inclusions in the javascript files
          if ( !empty($this->lang_file) ){
            $tmp = json_decode(file_get_contents($this->lang_file), true);
            $path = $this->plugin ? substr($this->path, \strlen($this->plugin) + 1) : $this->path;
            //die(var_dump(count($tmp), 'components/'.$this->path.'/'.$this->path, $tmp));
            if ( $translations = $tmp['mvc/'.$path] ?? ($tmp['components/'.$path] ?? null) ){
              $json = json_encode($translations);
              $tmp = <<<JAVASCRIPT
(data) => {
  bbn.fn.autoExtend("lng", $json)
};
JAVASCRIPT;
              $this->content = $tmp.$this->content;
            }
            unset($tmp, $translations);
          }
					return $this->content;
        case 'coffee':
					return $this->content;
        case 'css':
					return $this->content;
        case 'less':
			    $less = new \lessc();
          return $less->compile($this->content);
        case 'scss':
          $scss = new \Leafo\ScssPhp\Compiler();
					return $scss->compile($this->content);
				case 'html':
					return empty($data) ? $this->content : bbn\tpl::render($this->content, $data);
        case 'php':
          $dir = getcwd();
          chdir(dirname($this->file));
          $r = bbn\mvc::include_php_view($this->file, $this->content, $data ?: []);
          chdir($dir);
          return $r;
      }
		}
		return false;
	}
public function get ( array $ data = null ) { if ( $ this -> check ( ) ) { if ( \ is_null ( $ this -> content ) ) { $ this -> content = file_get_contents ( $ this -> file ) ; } if ( empty ( $ this -> content ) ) { return '' ; } if ( $ this -> checkers ) { $ st = '' ; foreach ( $ this -> checkers as $ chk ) { $ st .= file_get_contents ( $ chk ) ; } $ this -> content = $ st . $ this -> content ; } switch ( $ this -> ext ) { case 'js' : // Language variables inclusions in the javascript files if ( ! empty ( $ this -> lang_file ) ) { $ tmp = json_decode ( file_get_contents ( $ this -> lang_file ) , true ) ; $ path = $ this -> plugin ? substr ( $ this -> path , \ strlen ( $ this -> plugin ) + 1 ) : $ this -> path ; //die(var_dump(count($tmp), 'components/'.$this->path.'/'.$this->path, $tmp)); if ( $ translations = $ tmp [ 'mvc/' . $ path ] ?? ( $ tmp [ 'components/' . $ path ] ?? null ) ) { $ json = json_encode ( $ translations ) ; $ tmp =  <<<JAVASCRIPT
(data) => {
  bbn.fn.autoExtend("lng", $json)
};
JAVASCRIPT ; $ this -> content = $ tmp . $ this -> content ; } unset ( $ tmp , $ translations ) ; } return $ this -> content ; case 'coffee' : return $ this -> content ; case 'css' : return $ this -> content ; case 'less' : $ less = new \ lessc ( ) ; return $ less -> compile ( $ this -> content ) ; case 'scss' : $ scss = new \ Leafo \ ScssPhp \ Compiler ( ) ; return $ scss -> compile ( $ this -> content ) ; case 'html' : return empty ( $ data ) ? $ this -> content : bbn \ tpl :: render ( $ this -> content , $ data ) ; case 'php' : $ dir = getcwd ( ) ; chdir ( dirname ( $ this -> file ) ) ; $ r = bbn \ mvc :: include_php_view ( $ this -> file , $ this -> content , $ data ? : [ ] ) ; chdir ( $ dir ) ; return $ r ; } } return false ; }
Processes the controller and checks whether it has been routed or not.

@return bool
Processes the controller and checks whether it has been routed or not .