lollipop

A PHP-framework
Log | Files | Refs

commit f4eb9747be434ce220486aca4a59af182011a313
parent 4408df8030a54fb1a614b77200779042bca07851
Author: MoiBaguette <[email protected]>
Date:   Sun, 25 Jun 2023 17:24:08 +0200

css

Diffstat:
MController/Templates.php | 7++++++-
MLollipop/Router.php | 16++++++++--------
2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Controller/Templates.php b/Controller/Templates.php @@ -115,7 +115,12 @@ namespace Controller{ $table .= "<tr>"; $col_names = $obj->get_column_names(); foreach($col_names as $col){ - $table .= '<td>' . $obj->{$col} . '</td>'; + $table .= '<td>'; + if($col == "email" || $col == "exam" || $col == "course"){ + $table .= "<a>$col</a></td>"; + }else{ + $table .= $obj->{$col} . '</td>'; + } } $table .= ' <td> diff --git a/Lollipop/Router.php b/Lollipop/Router.php @@ -1,11 +1,9 @@ -<?php - -const MIME_TYPES = array( - "css" => "text/css", - "js" => "text/javascript" -); - +<?php namespace Lollipop { + const MIME_TYPES = array( + "css" => "text/css", + "js" => "text/javascript" + ); class Router { protected array $routes = []; @@ -16,7 +14,9 @@ namespace Lollipop { $this->temp = $temp; } - protected function set_mime(string $file) { + protected function set_mime($file) { + if($file == null) + return "text/html"; $ext = pathinfo($file, PATHINFO_EXTENSION); if (array_key_exists($ext, MIME_TYPES))