17 lines
		
	
	
		
			331 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			331 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| require("../app/inc.php");
 | |
| 
 | |
| // Instantiate a new controller
 | |
| $contr = new Controller;
 | |
| 
 | |
| // Grab the model
 | |
| $model = $contr->model('Index');
 | |
| 
 | |
| // Perform database task with model 
 | |
| $username = $model->getUsername();
 | |
| 
 | |
| // Display view with retrieved data 
 | |
| $contr->view('index', [
 | |
|     "title" => "Forside",
 | |
|     "data" => $username
 | |
| ]); |