Skip to content

Instantly share code, notes, and snippets.

@geggleto
Created January 26, 2016 21:00
Show Gist options
  • Select an option

  • Save geggleto/2b5e058a73baeefe63d0 to your computer and use it in GitHub Desktop.

Select an option

Save geggleto/2b5e058a73baeefe63d0 to your computer and use it in GitHub Desktop.
slim 3 gist 3
$app->get('/hello[/[{name}]]', function ($req, $res, $args) {
$get = $req->getQueryParams(); // Grab the Query Params... ["test" => "true"]
if (!empty($args['name'])) {
return $this->view->render($res, "hello.twig", ["name" => $args['name'], "test" => $get['test']]);
} else {
return $this->view->render($res, "hello.twig", ["name" => "", "test" => $get['test']]);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment