/** * Action to list posts * * Loads all the posts from the database. * No HTTP parameters are needed. * * The views are: * <ul> * <li>posts/index (via include)</li> * </ul> */ public function index() { // obtain the data from the database $posts = $this->postMapper->findAll(); // put the array containing Post object to the view $this->view->setVariable("posts", $posts); // render the view (/view/posts/index.php) $this->view->render("posts", "index"); }
/** * Action to list posts * * Loads all the posts from the database. * No HTTP parameters are needed. * * The views are: * <ul> * <li>posts/index (via include)</li> * </ul> */ public function index() { //esta funcion se diferencia con al abajo en que una muestra una cabezara de imagen y otro no //se podria mejorar para siplicar pero weno... //POR QUE TENEMOS DOS VISTAS DE LOS MISMO?¿?¿? ESTO SOBRA // find the Post object in the database $pinchos = $this->pinchoMapper->findAll(); // put the Post object to the view $this->view->setVariable("pincho", $pincho); // check if comment is already on the view (for example as flash variable) // if not, put an empty Comment for the view // render the view (/view/posts/view.php) $this->view->render("pincho", "index"); }