Answer the question
In order to leave comments, you need to log in
How to create layout in mvc php?
Hello.
My question is:
How to create mvc with support for different layouts?
For example, earlier I wrote simply in View:
class View {
public function render($name){
require_once ROOT.'views/header.php';
require_once ROOT.'views/'.$name.'.php';
require_once ROOT.'views/footer.php';
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>Title <?=$title?></title>
</head>
<body>
<?php echo $this->getContent(); ?> //как то так
<footer></footer>
</div>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question