Created
May 13, 2024 18:01
-
-
Save rodrigophpweb/a4d3542982f391734a206f9b840ab615 to your computer and use it in GitHub Desktop.
Code Refactoring Categories A to Z
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$letters = range('a', 'z'); // Array com todas as letras do alfabeto | |
foreach ($letters as $letter) { | |
$title = "Serviços que começam com a letra $letter - " . TITLE_GERAL; | |
$active = (isset($varCliente) && $varCliente == $letter) ? '<span class="active">' . $letter . '</span>' : $letter; | |
$href = ($letter != 'todos') ? "/servicos/{$varCidade}/{$letter}" : "/servicos/{$varCidade}"; | |
echo "<a href=\"{$href}\" title=\"{$title}\">{$active}</a>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment