File tree Expand file tree Collapse file tree 6 files changed +30
-14
lines changed Expand file tree Collapse file tree 6 files changed +30
-14
lines changed Original file line number Diff line number Diff line change @@ -33,18 +33,18 @@ public function setVariable($name, $value)
33
33
* @param $templateFileName
34
34
*/
35
35
public function insertTemplate ($ templateFileName )
36
- {
37
- require (APP_LOCATION . '/templates/ ' . $ templateFileName );
38
- }
39
-
40
- public function render ()
41
36
{
42
37
// Add normal escaped variables to the template
43
38
foreach ($ this ->rawVariables as $ name => $ value ) {
44
39
// Yes I want to explode out the variables here by name
45
40
$ $ name = htmlentities ($ value );
46
41
}
47
42
48
- require (APP_LOCATION . '/templates/ ' . $ this ->phpTemplateFile );
43
+ require (APP_LOCATION . '/templates/ ' . $ templateFileName );
44
+ }
45
+
46
+ public function render ()
47
+ {
48
+ $ this ->insertTemplate ($ this ->phpTemplateFile );
49
49
}
50
50
}
Original file line number Diff line number Diff line change
1
+ <script src =" https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity =" sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin =" anonymous" ></script >
2
+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity =" sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin =" anonymous" ></script >
3
+ <script src =" https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity =" sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin =" anonymous" ></script >
1
4
</body >
2
5
</html >
Original file line number Diff line number Diff line change 1
- <html >
1
+ <!doctype html>
2
+ <html lang =" en" >
2
3
<head >
4
+ <!-- Required meta tags -->
5
+ <meta charset = " utf-8" >
6
+ <meta name = " viewport" content = " width=device-width, initial-scale=1, shrink-to-fit=no" >
7
+
3
8
<title >Your Website Name</title >
9
+ <link rel = " stylesheet" href = " https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity = " sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin = " anonymous" >
10
+ <link rel = " stylesheet" href = " /css/main.css" >
4
11
</head >
5
12
<body >
Original file line number Diff line number Diff line change 1
1
<?php $ this ->insertTemplate ('header.php ' ); ?>
2
2
<?php $ this ->insertTemplate ('users/loginBar.php ' ); ?>
3
- Hello <?php echo (($ name ) ? $ name : 'world ' ); ?> !
4
- <form action="" method="post">
5
- Your Name:<input type="text" name="name" value="<?php echo $ name ; ?> ">
6
- <input type="submit" value="Submit">
7
- </form>
3
+ <div class="container">
4
+ <h1>Hello <?php echo (($ name ) ? $ name : 'world ' ); ?> !</h1>
5
+ <form action="" method="post">
6
+ Your Name:<input type="text" name="name" value="<?php echo $ name ; ?> ">
7
+ <input type="submit" value="Submit">
8
+ </form>
9
+ </div>
8
10
<?php $ this ->insertTemplate ('footer.php ' ); ?>
Original file line number Diff line number Diff line change 1
- <div id="login-bar" class="top-bar">
1
+ <div id="login-bar" class="top-bar container-fluid text-right ">
2
2
<?php
3
3
if (\Di \Di::getAuth ()->isLoggedIn ()) {
4
4
$ user = \Di \Di::getAuth ()->getLoggedInUser ();
5
5
?>
6
6
You are logged in as <?php echo $ user ->getFirstName (); ?> <?php echo $ user ->getLastName (); ?> . <a href="/Auth/logout">Log Out</a>
7
7
<?php } else { ?>
8
- Please log in!
9
8
<form action="/Auth/login" method="post">
9
+ Log In
10
10
Email:<input type="text" name="email" value="">
11
11
Password:<input type="password" name="password" value="">
12
12
<input type="submit" value="Submit">
Original file line number Diff line number Diff line change
1
+ .top-bar {
2
+ color : # FFF ;
3
+ background-color : # 000 ;
4
+ }
You can’t perform that action at this time.
0 commit comments