<?php
// 引入樣板引擎檔
require_once 'vendor/autoload.php';
// 建立Smarty物件
$smarty = new Smarty;
// 設定要傳到樣板的變數
$page_title = '待辦清單';
$header = '我的待辦清單';
$navbar = array('home' => '回首頁','post' => "發布待辦事項" );
//二維陣列
//法一
// $content[1]['done'] = "完成";
// $content[1]['directions'] = "撰寫程式";
// $content[1]['end'] = "2021/03/13";
// $content[1]['priority'] = "低";
// $content[1]['asign'] = "李大頭";
// $content[2]['done'] = "完成2";
// $content[2]['directions'] = "撰寫程式2";
// $content[2]['end'] = "2021/03/13";
// $content[2]['priority'] = "低2";
// $content[2]['asign'] = "李大頭2";
// 法二
// $content=array(
// '1' => array('done' => '完成', 'directions'=> "撰寫程式",'end' => '2021/03/13', 'priority'=> "低",'asign'=> "李大頭"),
// );
// 法三
$content=[
'1' => ['done' => '完成', 'directions'=> "撰寫程式",'end' => '2021/03/13', 'priority'=> "低",'asign'=> "李大頭"],
'2' => ['done' => '未完成', 'directions'=> "開會",'end' => '2021/03/20', 'priority'=> "高",'asign'=> "李大頭、吳大大"],
'3' => ['done' => '未完成', 'directions'=> "社大上課",'end' => '2021/03/21', 'priority'=> "高",'asign'=> "李大頭、吳大大、郭大大"],
];
// 將變數送到Smarty樣板檔
$smarty->assign('page_title', $page_title);
$smarty->assign('header', $header);
$smarty->assign('navbar', $navbar);
$smarty->assign('content', $content);
// 呈現在哪個檔案 templates/xxx.tpl
$smarty->display('index.tpl');