Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
MySymfony
<?php
namespace MySymfony;
class HttpKernel
{
public function handle(Request $req)
{
$name = $req->query('name');
$response = new Response('hello ' . $name);
return $response;
}
}
class Request
{
public function __construct($get)
{
$this->get = $get;
}
public function query($key)
{
return $this->get[$key];
}
}
class Response
{
public function __construct($msg)
{
$this->body = $msg;
}
public function send()
{
echo $this->body;
}
}
$kernel = new HttpKernel;
$request = new Request($_GET);
$response = $kernel->handle($request);
$response->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment