Skip to content

Instantly share code, notes, and snippets.

@geggleto
Created January 26, 2016 22:12
Show Gist options
  • Select an option

  • Save geggleto/0afe9f23d6965b0235a7 to your computer and use it in GitHub Desktop.

Select an option

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