기본 템플릿 파일 (main.tpl)이 있고 <body>
태그 사이에 서브 페이지를 포함하고 싶습니다. Smarty - 기본 페이지에 서브 페이지 포함
과 결합 -> 1 부 main.tpl + news.tpl + main.tpl의 두 번째 부분
News.tpl에는 텍스트와 PHP 코드가 포함되어 있습니다. 예 :
Hello, <php echo $username ?>. Some random text.
기본 템플릿 파일 (main.tpl)이 있고 <body>
태그 사이에 서브 페이지를 포함하고 싶습니다. Smarty - 기본 페이지에 서브 페이지 포함
과 결합 -> 1 부 main.tpl + news.tpl + main.tpl의 두 번째 부분
News.tpl에는 텍스트와 PHP 코드가 포함되어 있습니다. 예 :
Hello, <php echo $username ?>. Some random text.
: main.tpl에서
$smarty->assign('module', 'news');
$smarty->display('main.tpl');
은 모듈 템플릿을 포함한다 :
<body>{include file="$module.tpl"}</body>
당신은 찾을 수 있습니다 여기에 더 약 {include}
유식 기능 : http://www.smarty.net/docs/en/language.function.include.tpl
당신은 $smarty->display("main.tpl")
을해야하고 main.tpl에서 news.tpl을 포함한다.
템플릿에 PHP 코드가 포함되어 있으면 Smarty가 전혀 필요하지 않습니다. 템플릿 파일은 include
입니다. 유식 변수에 PHP 할당 템플릿 이름에서
고마워요.) – Miso
@Miso 왜 당신이 "News.tpl에 PHP 코드가 들어있을 것입니다" –