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
}
}
?>
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
}
}
?>
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
}
}
?>
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
}
}
?>
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>";
}
}
?>
require_once "View.php";
class LetsBuildView extends View{
function render($data = []){
?><h1><?=$data['title']?></h1><p><?=$data['content']?></p>
<?php
}
}
function render($data = []){
?>
<h1><?=$data['title']?></h1>
<p><?=$data['content']?></p>
<?php
}
}
function renderHeader($data) {
?>
<!DOCTYPE
<html>
<head>
<title><?php echo $data['title']; ?></title>
</head>
<body>
<?php
}
function renderFooter($data) {
echo "</body>";
echo "</html>";
}
}
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
}
} ?>
public function renderHeader($data){
echo "<!DOCTYPE html> <html> <head>";
echo "<title>".$data['title']."</title> </head><body>";
}
public function renderFooter($data){
echo "</body></html>" ;
}
}
public function render ($data = []) {
echo "<h1>".$data['title']."</h1>";
echo "<p>".$data['content']."</p>";
}
}
<?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}
}?>
<?php
require('View.php');
class letsBuildView extends View
{
public function render($data)
{
print("<h1>$data['title']</h1><p>$data['content']</p>");
}
}
?>
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
}
}
?>
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>";
}
}
?>