Skip to content

Instantly share code, notes, and snippets.

@rodrigoSyscop
Last active February 17, 2018 16:02
Show Gist options
  • Save rodrigoSyscop/cc66681103129dc548deb2afeebb7d44 to your computer and use it in GitHub Desktop.
Save rodrigoSyscop/cc66681103129dc548deb2afeebb7d44 to your computer and use it in GitHub Desktop.
Index usando HttpFoundation
<?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