./categories/back-end
Smarty assign 템플릿 변수
Smarty assign() — 템플릿에 값 전달
// 이름/값 쌍
$smarty->assign('Name', 'Fred');
$smarty->assign('Address', $address);
// 연관 배열
$smarty->assign(array('city' => 'Lincoln', 'state' => 'Nebraska'));
// 배열
$myArray = array('no' => 10, 'label' => 'Peanuts');
$smarty->assign('foo', $myArray);
// DB 조회 결과(adodb 예시)
$sql = "select id, name, email from contact where id=" . $id;
$smarty->assign('contact', $db->getRow($sql));
관련 링크: https://www.smarty.net/docsv2/en/api.assign.tpl
./comments