Ver Mensaje Individual
  #52 (permalink)  
Antiguo 04/03/2012, 17:24
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: Paginator Zend Framework 2.0 beta

Este es el issue, aunque el único comentario es mio .

El usuario que lo abrió propone un "parche" para inyectar los parámetros al request, aunque te digo, no me convence del todo porque precisamente, es parte de la ruta, no es parte del GET ni del POST...

De hecho en la lista de los controllers, más bien en la documentación indica esto:

Cita:
12.5.1.1. InjectApplicationEvent
The Zend\Mvc\InjectApplicationEvent interface hints to the Application instance that it should inject its MvcEvent into the controller itself. Why would this be useful?

Recall that the MvcEvent composes a number of objects: the Request and Response, naturally, but also the router, the route matches (a RouteMatch instance), and potentially the "result" of dispatching.

A controller that has the MvcEvent injected, then, can retrieve or inject these. As an example:

Código PHP:
Ver original
  1. $matches = $this->getEvent()->getRouteMatch();
  2. $id      = $matches->getParam('id', false);
  3. if (!$id) {
  4.     $this->getResponse();
  5.     $response->setStatusCode(500);
  6.     $this->getEvent()->setResult('Invalid identifier; cannot complete request');
  7.     return;
  8. }
The InjectApplicationEvent interface defines simply two methods:

Código PHP:
Ver original
  1. use Zend\EventManager\EventDescription as Event;
  2.  
  3. public function setEvent(Event $event);
  4. public function getEvent($event);
Por lo que creo que no van a cambiar eso, debes de usar el RouteMatch para sacar los parámetros de la ruta, y no usar ni GET, ni POST...