Last active
February 17, 2018 16:02
-
-
Save rodrigoSyscop/cc66681103129dc548deb2afeebb7d44 to your computer and use it in GitHub Desktop.
Index usando HttpFoundation
This file contains hidden or 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 | |
// framework/index.php | |
require_once __DIR__.'/vendor/autoload.php'; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
$request = Request::createFromGlobals(); | |
$input = $request->get('name', 'World'); | |
$response = new Response( | |
sprintf('Hello %s', htmlspecialchars($input, ENT_QUOTES, 'UTF-8')) | |
); | |
$response->send(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment