Mistralys /
application-utils
| 1 | <?php |
||||
| 2 | /** |
||||
| 3 | * Example of URL syntax highlighting. |
||||
| 4 | * |
||||
| 5 | * @package Application Utils |
||||
| 6 | * @subpackage Examples |
||||
| 7 | * @author Sebastian Mordziol <[email protected]> |
||||
| 8 | */ |
||||
| 9 | |||||
| 10 | declare(strict_types=1); |
||||
| 11 | |||||
| 12 | /** |
||||
| 13 | * Examples environment config |
||||
| 14 | */ |
||||
| 15 | require_once '../prepend.php'; |
||||
| 16 | |||||
| 17 | use function AppUtils\parseURL; |
||||
| 18 | use AppUtils\URLInfo; |
||||
| 19 | use function AppLocalize\pt; |
||||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||||
| 20 | |||||
| 21 | $urls = array( |
||||
| 22 | 'http://www.foo.com', |
||||
| 23 | 'https://www.foo.com:3618/path/to/page', |
||||
| 24 | 'https://username:[email protected]/path/to/page?foo=bar&bar=foo', |
||||
| 25 | 'https://www.foo.com/path/to/page#fragment', |
||||
| 26 | ); |
||||
| 27 | |||||
| 28 | ?><!DOCTYPE html> |
||||
| 29 | <html lang="en"> |
||||
| 30 | <head> |
||||
| 31 | <meta charset="utf-8"> |
||||
| 32 | <title><?php pt('URL syntax highlighting') ?></title> |
||||
|
0 ignored issues
–
show
The function
pt was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 33 | <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> |
||||
| 34 | <link rel="stylesheet" type="text/css" href="../css/ui.css"> |
||||
| 35 | <style><?php echo URLInfo::getHighlightCSS() ?></style> |
||||
| 36 | </head> |
||||
| 37 | <body> |
||||
| 38 | <p> |
||||
| 39 | <a href="../index.php">« <?php pt('Back') ?></a> |
||||
| 40 | </p> |
||||
| 41 | <br> |
||||
| 42 | <p> |
||||
| 43 | <?php pt('This example showcases the built-in syntax highlighting of URLs.') ?> |
||||
| 44 | </p> |
||||
| 45 | <br> |
||||
| 46 | <?php |
||||
| 47 | |||||
| 48 | foreach($urls as $url) |
||||
| 49 | { |
||||
| 50 | $info = parseURL($url); |
||||
| 51 | |||||
| 52 | echo '<p>'.$info->getHighlighted().'</p>'; |
||||
| 53 | } |
||||
| 54 | |||||
| 55 | ?> |
||||
| 56 | </body> |
||||
| 57 | </html> |
||||
| 58 |