アーキテクチャMVCでコンテンツを表示するにはどうすればよいですか?実際に私は次のようにやっている:mvcでメニューを表示する最も良い方法は何ですか?
<?php
class view {
function __construct(){
}
function __set($var,$value){
$this->var = $value;
}
function __get($var){
return $this->var;
}
function render($render, $noinclude = false){
if($noinclude == true){
require ("view/template/".$render.".php");
}
else{
require ("view/template/headerTPL.html");
require ("view/template/bannerTPL.html");
require ("view/template/menuTPL.html");
require ("view/template/".$render.".php");
require ("view/template/footerTPL.html");
}
}
function show($value){
$this->value = $value;
}
function alert($value){
echo "<script>alert('{$value}')</script>";
}
}
?>
<div id="conteudo">
<?php require $this->menu; ?>
</div>
これは私のrender.php/\
あるTPLを含むように、それは間違っていますか?私はどうすればいいのですか?
あなたはすでにhttp://stackoverflow.com/questions/9780247/mvc-problems-problems-with-viewsとhttp://stackoverflow.com/questions/9760250/how-the-bestway- make-a-menu-with-php-mvc ..スパムを止める。 –
ああ、申し訳ありませんが、私はこのトピックをもう見ていませんでした。 u – user1258260
に感謝します。彼らはすべてここにいるはずです:http://stackoverflow.com/users/1258260/user1258260?tab=questions –