private static function _compute_villes_footer_links_html() { $sp = Routing::get_request_sub_route_key(); $villes_o = new Villes(); $ville_keys = $villes_o->get_ville_keys(); $villex = $ville_linkx = []; if (!isset($sp)) { foreach ($ville_keys as $key) { if ($villes_o->has_specific_template($key)) { $villex[$key] = $villes_o->get_label($key); } } } else { $villes = $ville_keys; $GLOBALS['debug'][] = ['villes' => $villes]; foreach ($ville_keys as $key) { array_shift($villes); if ($key == $sp) { break; } } $GLOBALS['debug'][] = ['villes' => $villes]; $villes2 = array_slice($villes, 0, 5); $GLOBALS['debug'][] = ['villes2' => $villes2]; $reste = 5 - count($villes2); for ($i = 0; $i < $reste; $i++) { $villes2[] = $ville_keys[$i]; } $GLOBALS['debug'][] = ['villes2' => $villes2]; foreach ($villes2 as $key) { $villex[$key] = $villes_o->get_label($key); } } $complements = ['Réparation volet roulant ', 'Dépannage volet roulant ', 'Motorisation volet ', 'Isolation fenêtre porte ', 'Changement double-vitrage ']; $i = 0; foreach ($villex as $key => $label) { $ville_linkx[] = ['label' => $complements[$i] . $label, 'url' => '/ville/' . $key]; $i++; } return $ville_linkx; }
<?php namespace DF56; require_once CLASS_PATH . 'villes.php'; $ville = Routing::get_request_sub_route_key(); $villes_o = new Villes(); $villex = $villes_o->get_villex($ville); ?> <div class="container"> <div class="row"> <div class="col-xs-12"> <?php include $villes_o->get_template($ville); ?> </div> </div> </div><?php