Inheritance: extends ModelAdmin
 public function action(Request $request)
 {
     switch ($request->get("action")) {
         case "ajouter":
             ZoneAdmin::getInstance()->add($request->request->get('nom'));
             break;
         case "supprimer":
             ZoneAdmin::getInstance($request->query->get('id'))->delete();
             break;
     }
 }
Ejemplo n.º 2
0
ActionsAdminModules::instance()->inclure_module_admin("zone");
?>
            <div class="bigtable">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th><?php 
echo trad("Description", "admin");
?>
</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
foreach (ZoneAdmin::getInstance()->getList() as $zone) {
    ?>
                        <tr>
                            <td><?php 
    echo $zone->nom;
    ?>
</td>
                            <td>
                                <div class="btn-group">
                                    <a class="btn btn-mini" href="zone.php?id=<?php 
    echo $zone->id;
    ?>
&action=showZone#zone"><i class="icon-edit"></i></a>
                                    <a href="zone.php?action=supprimer&id=<?php 
    echo $zone->id;
    ?>