$smarty->assign("success", true);
    } else {
        $smarty->assign("error", true);
    }
}
if (isset($_POST['updateMasa'])) {
    if (updateMasa()) {
        $smarty->assign("success", true);
    } else {
        $smarty->assign("error", true);
    }
}
if (isset($_POST['removeMasa'])) {
    if (deleteMasa()) {
        $smarty->assign("success", true);
    } else {
        $smarty->assign("error", true);
    }
}
if (isset($_POST['saveMasa'])) {
    if (insertMasa()) {
        $smarty->assign("success", true);
    } else {
        $smarty->assign("error", true);
    }
}
// Muestra todos los datos sobre Masas e ingredientes.
$smarty->assign("masas", getAllMasas());
$smarty->assign("ingredientes", getAllIngredientes());
// Pinta el template
$smarty->display("vistas/gestPizza.tpl");
示例#2
0
<?php

// Introduce los archivos requeridos
require_once 'core/init.php';
require_once 'controladores/masasController.php';
require_once 'controladores/ingredientesController.php';
$masas = getAllMasas();
$ingredientes = getAllIngredientes();
$smarty->assign("masas", $masas);
$smarty->assign("ingredientes", $ingredientes);
// Pinta el template
$smarty->display("vistas/index.tpl");