예제 #1
0
 public function index(Request $request)
 {
     // var_dump($request);
     $view = new View('home', ['message' => 'hello from a View']);
     $response = $view->render();
     $response->send();
     //return 'Hello at ' . $request->getRequestUri() . ' from Controller';
 }
예제 #2
0
 public function index(Request $request)
 {
     //var_dump($request);
     $autores = $this->imprint->listaAutores();
     $first = $autores->first();
     $view = new View('home', ['autores' => $autores, 'firstAutor' => $first]);
     $response = $view->render();
     $response->send();
 }
예제 #3
0
 public function index($request)
 {
     $author = new Author('*****@*****.**', '12345678', 'AUTOR_DE_PLATZI');
     $author->setName('Hector', 'Flores');
     $posts = [new Post($author, 'Post #1', 'This is the first post'), new Post($author, 'Post #2', 'This is the second post'), new Post($author, 'Post #3', 'This is the third post'), new Post($author, 'Post #4', 'This is the fourth post')];
     $view = new View('home', ['posts' => $posts]);
     $response = $view->render();
     //echo "<pre>".print_r($request, true)."</pre>";
     //return "Hello at ".
     //$request->getRequestUri().
     //' from Controller';
 }
예제 #4
0
 public function show($id)
 {
     $post = $this->imprint->findById($id);
     $view = new View('post_details', ['post' => $post]);
     return $view->render();
 }
예제 #5
0
 public function index(Request $request)
 {
     $view = new View('home', ['message' => 'hello of the view']);
     $response = $view->render();
     $response->send();
 }
예제 #6
0
 public function show($id)
 {
     $posts = $this->db->posts();
     $view = new View('post_details', ['post' => $posts->get($id)]);
     return $view->render();
 }