스마티 Smarty

(Smarty에서 넘어옴)

1 개요[ | ]

Smarty
스마티
  • 웹 템플릿 엔진
  • 작성언어: PHP
  • 라이선스: LGPL

 

2 예시[ | ]

<!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>
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 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}