2016-10-19

Let's Build Something.

Post your solutions to the Oct 19th Let's Build Something here.
Best, Chris
Post your solutions to the Oct 19th Let's Build Something here. Best, Chris

-- Let's Build Something
//WebLayout.php <?php require_once "Layout.php";
class WebLayout extends Layout {
    function renderHeader($data) {
        $title = null;
        if(isset($data['title'])) {
            $title = $data['title'];
        }
        else {
            $title = "Default Title";
        }
        ?>
        <!DOCTYPE html>
        <html>
        <head>
            <title><?= $title ?></title>
        </head>
<?php
    }
    function renderFooter($data) {
        ?>
        </html>
        <?php
    }
} ?>
//LetsBuildView.php <?php require_once "View.php";
class LetsBuildView extends View {
    public function render($data = []) {
        $content = null;
        if(isset($data['content'])) {
            $content = $data['content'];
        }
        else {
            $content = "Content";
        }
        $title = null;
        if(isset($data['title'])) {
            $title = $data['title'];
        }
        else {
            $title = "Default Title";
        }
        ?>
        <body>
            <h1><?= $title ?></h1>
            <p><?= $content ?></p>
        </body>
<?php
    }
} ?>
//WebLayout.php <?php require_once "Layout.php"; class WebLayout extends Layout { function renderHeader($data) { $title = null; if(isset($data['title'])) { $title = $data['title']; } else { $title = "Default Title"; } ?> <!DOCTYPE html> <html> <head> <title><?= $title ?></title> </head> <?php } function renderFooter($data) { ?> </html> <?php } } ?> //LetsBuildView.php <?php require_once "View.php"; class LetsBuildView extends View { public function render($data = []) { $content = null; if(isset($data['content'])) { $content = $data['content']; } else { $content = "Content"; } $title = null; if(isset($data['title'])) { $title = $data['title']; } else { $title = "Default Title"; } ?> <body> <h1><?= $title ?></h1> <p><?= $content ?></p> </body> <?php } } ?>

-- Let's Build Something
<?php require_once "View.php"; class LetsBuildView extends View {
    public function render($data = []) {
        $content = ;
        if(isset($data['content'])) {
            $content = $data['content'];
        }
        $title = 	;
        if(isset($data['title'])) {
            $title = $data['title'];
        }
        ?>
        <body>
            <h1><?php echo $title ?></h1>
            <p><?php echo $content ?></p>
        </body>
<?php
    }
} ?>
<?php require_once "Layout.php"; class WebLayout extends Layout {
    function renderHeader($data) {
        $title = '';
        if(isset($data['title'])) {
            $title = $data['title'];
        }
        ?>
        <!DOCTYPE html>
        <html>
        <head>
            <title><?php echo $title ?></title>
        </head>
<?php
    }
    function renderFooter($data) {
?>
        </html>
<?php
    }
} ?>
<?php require_once "View.php"; class LetsBuildView extends View { public function render($data = []) { $content = ''; if(isset($data['content'])) { $content = $data['content']; } $title = ''; if(isset($data['title'])) { $title = $data['title']; } ?> <body> <h1><?php echo $title ?></h1> <p><?php echo $content ?></p> </body> <?php } } ?> <?php require_once "Layout.php"; class WebLayout extends Layout { function renderHeader($data) { $title = ''; if(isset($data['title'])) { $title = $data['title']; } ?> <!DOCTYPE html> <html> <head> <title><?php echo $title ?></title> </head> <?php } function renderFooter($data) { ?> </html> <?php } } ?>

-- Let's Build Something
<?php
	require_once "Layout.php";
 class WebLayout extends Layout{
	 function renderHeader($data){
		?> <!DOCTYPE>
				<head><title><?=$data['title']?></title></head>
				<body>
		<?php
	}
	 function renderFooter($data){
		echo "</body></html>";
	}
} ?>
<?php
	require_once "View.php";
	 class LetsBuildView extends View{
		 function render($data = []){
			?><h1><?=$data['title']?></h1><p><?=$data['content']?></p>
			<?php
		}
	}
<?php require_once "Layout.php"; class WebLayout extends Layout{ function renderHeader($data){ ?> <!DOCTYPE> <head><title><?=$data['title']?></title></head> <body> <?php } function renderFooter($data){ echo "</body></html>"; } } ?> <?php require_once "View.php"; class LetsBuildView extends View{ function render($data = []){ ?><h1><?=$data['title']?></h1><p><?=$data['content']?></p> <?php } }

-- Let's Build Something
LetsBuildView.php
<?php require_once "View.php";
class LetsBuildView extends View{
    
    function render($data = []){
    ?>
        <h1><?=$data['title']?></h1>
        <p><?=$data['content']?></p>
    <?php
    }  
}
WebLayout.php
<?php require_once "Layout.php";
class WebLayout extends Layout {
    
    function renderHeader($data) {
    ?>
        <!DOCTYPE
        <html>
            <head>
                <title><?php echo $data['title']; ?></title>
            </head>
            <body>
    <?php
    }
    
    function renderFooter($data) {
        echo "</body>";
        echo "</html>";
    }
    
}
(Edited: 2016-10-19)
LetsBuildView.php <?php require_once "View.php"; class LetsBuildView extends View{ function render($data = []){ ?> <h1><?=$data['title']?></h1> <p><?=$data['content']?></p> <?php } } WebLayout.php <?php require_once "Layout.php"; class WebLayout extends Layout { function renderHeader($data) { ?> <!DOCTYPE <html> <head> <title><?php echo $data['title']; ?></title> </head> <body> <?php } function renderFooter($data) { echo "</body>"; echo "</html>"; } }

-- Let's Build Something
<?php
	require_once "View.php"; 
class LetsBuildView extends View {
    public function render($data = []) {
        if(isset($data['content'])) {
            $content = $data['content'];
        }
        $title = 	;
        if(isset($data['title'])) {
            $title = $data['title'];
        }
        ?>
	<!DOCTYPE html>
	<html>
	<head>
		<title><?php echo $title></title>
        <body>
            <h1><?php echo $title ?></h1>
            <p><?php echo $content ?></p>
        </body>
<?php
    }
} ?> <?php require_once "Layout.php"; class WebLayout extends Layout {
    function renderHeader($data) {
        $title = '';
        if(isset($data['title'])) {
            $title = $data['title'];
        }
        ?>
        <!DOCTYPE html>
        <html>
        <head>
            <title><?php echo $title ?></title>
        </head>
<?php
    }
    function renderFooter($data) {
?>
        </html>
<?php
    }
} ?>
<?php require_once "View.php"; class LetsBuildView extends View { public function render($data = []) { if(isset($data['content'])) { $content = $data['content']; } $title = ; if(isset($data['title'])) { $title = $data['title']; } ?> <!DOCTYPE html> <html> <head> <title><?php echo $title></title> <body> <h1><?php echo $title ?></h1> <p><?php echo $content ?></p> </body> <?php } } ?> <?php require_once "Layout.php"; class WebLayout extends Layout { function renderHeader($data) { $title = ''; if(isset($data['title'])) { $title = $data['title']; } ?> <!DOCTYPE html> <html> <head> <title><?php echo $title ?></title> </head> <?php } function renderFooter($data) { ?> </html> <?php } } ?>

-- Let's Build Something
<?php //WebLayout require_once "Layout.php";
class WebLayout extends Layout {
    public function renderHeader($data){
        echo "<!DOCTYPE html> <html> <head>";
        echo "<title>".$data['title']."</title> </head><body>";
    }
    public function renderFooter($data){
        echo "</body></html>" ;
    }
}
<?php //LetsBuildView require_once "View.php";
class LetsBuildView extends View {
    public function render ($data = []) {
        echo "<h1>".$data['title']."</h1>";
        echo "<p>".$data['content']."</p>";
    }
}
<?php //WebLayout require_once "Layout.php"; class WebLayout extends Layout { public function renderHeader($data){ echo "<!DOCTYPE html> <html> <head>"; echo "<title>".$data['title']."</title> </head><body>"; } public function renderFooter($data){ echo "</body></html>" ; } } <?php //LetsBuildView require_once "View.php"; class LetsBuildView extends View { public function render ($data = []) { echo "<h1>".$data['title']."</h1>"; echo "<p>".$data['content']."</p>"; } }

-- Let's Build Something
WebLayout.php
 <?php
 require('Layout.php');
 class WebLayout
 {
	public function renderHeader($data)
	{?>
	<!DOCTYPE html>
	<html>
	<head><title><?=$data['title']?></title></head>
	<body>		
	
	<?php}
	public function renderFooter($data)
	{?>
		</body></html>		
	<?php}
 }?>
LetsBuildView.php
 <?php
 require('View.php');
 class letsBuildView extends View
 {
	public function render($data)
	{
		print("<h1>$data['title']</h1><p>$data['content']</p>");
	}
 }
 ?>
WebLayout.php <?php require('Layout.php'); class WebLayout { public function renderHeader($data) {?> <!DOCTYPE html> <html> <head><title><?=$data['title']?></title></head> <body> <?php} public function renderFooter($data) {?> </body></html> <?php} }?> LetsBuildView.php <?php require('View.php'); class letsBuildView extends View { public function render($data) { print("<h1>$data['title']</h1><p>$data['content']</p>"); } } ?>
2016-10-20

-- Let's Build Something
<?php require_once "View.php"; class LetsBuildView extends View {
    public function render($data = []) {
        $title = ;
        $content = 	;
        if (isset($data['title'])) {
            $title = $data['title'];
        }
        if (isset($data['content'])) {
            $content = $data['content'];
        }
        ?>
        <h1><?php echo $title ?></h1>
        <p><?php echo $content ?></p>
        <?php
    }
} ?>
<?php require_once "Layout.php"; class WebLayout extends Layout {
    function renderHeader($data) {
        $title = '';
        if (isset($data['title'])) {
            $title = $data['title'];
        }
        ?>
        <!DOCTYPE html>
        <html>
        <head>
        <title><?php echo $title ?></title>
        </head>
        <body>
        <?php
    }
    function renderFooter($data) {
        echo "</body></html>";
    }
} ?>
<?php require_once "View.php"; class LetsBuildView extends View { public function render($data = []) { $title = ''; $content = ''; if (isset($data['title'])) { $title = $data['title']; } if (isset($data['content'])) { $content = $data['content']; } ?> <h1><?php echo $title ?></h1> <p><?php echo $content ?></p> <?php } } ?> <?php require_once "Layout.php"; class WebLayout extends Layout { function renderHeader($data) { $title = ''; if (isset($data['title'])) { $title = $data['title']; } ?> <!DOCTYPE html> <html> <head> <title><?php echo $title ?></title> </head> <body> <?php } function renderFooter($data) { echo "</body></html>"; } } ?>

-- Let's Build Something

(Edited: 2016-10-20)
<nowiki><?php require_once('Layout.php'); class WebLayout extends Layout { public function renderHeader($data) { $title = null; if (isset($data['title'])) { $title = $data['title']; } else { $title = "Default"; } ?> <!DOCTYPE html> <html> <head> <title><?=$title?></title> </head> <?php } public function renderFooter($data) { ?> </html> <?php } } ?> <?php require_once('View.php'); class LetsBuildView extends View { public function render($data = []) { $title = null; $content = null; if (isset($data['title'])) { $title = $data['title']; } else { $title = "Default"; } if (isset($data['content'])) { $content = $data['content']; } else { $content = "Default"; } ?> <body> <h1><?=$title?></h1> <p><?=$content?></p> </body> <?php } } ?> </nowiki>
X