<?php
include 'db.php';
include 'Filmes2_model.php';
// Connect to database
$db = dbconnect($hostname,$db_name,$db_user,$db_passwd);
// put full path to Smarty.class.php
require('/usr/share/php/smarty/libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = 'templates';
$smarty->compile_dir = 'templates_c';
// get filmes
$filmes = get_filmes($db);
// faz a atribuição das variáveis do template smarty
$smarty->assign('filmes',$filmes);
// Mostra a tabela
$smarty->display('Filmes2_Smarty.tpl');
?>