1 개요[ | ]
- Smarty
- 스마티
- 웹 템플릿 엔진
- 작성언어: PHP
- 라이선스: LGPL
2 예시[ | ]
html
Copy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{$title_text|escape}</title>
</head>
<body> {* This is a little comment that won't be visible in the HTML source *}
{$body_html}
</body><!-- this is a little comment that will be seen in the HTML source -->
</html>
PHP
Copy
define('SMARTY_DIR', 'smarty-2.6.22/');
require_once(SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates/compile/';
$smarty->assign('title_text', 'TITLE: This is the Smarty basic example ...');
$smarty->assign('body_html', '<p>BODY: This is the message set using assign()</p>');
$smarty->display('index.tpl');
3 같이 보기[ | ]
4 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.