Skip to content

Instantly share code, notes, and snippets.

@Raistlfiren
Created April 11, 2016 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raistlfiren/58db48c0ac741f338398d43b3b102f2b to your computer and use it in GitHub Desktop.
Save Raistlfiren/58db48c0ac741f338398d43b3b102f2b to your computer and use it in GitHub Desktop.
<?php
use NewsHandler;
$this->get('/{id:[0-9]+}/edit', function(ServerRequestInterface $request, ResponseInterface $response, $args) {
//Typehint newsHandler automatically instead of doing ->
/** @var NewsHandler $news*/
// $news = $this->newsHandler;
$data = $this->newsHandler->getShow($args['id']);
return $this->view->render($response, 'news/show.html.twig', $data);
})->setName('new_edit');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment