I was playing around with JsonView and the PaginatorHelper and noticed that 
the data returned by $this->Paginator->next() was different to the one 
returned by the same method when using the normal (HTML) view. 

Digging into the code, I found out that the JsonView doesn't trigger the 
beforeRender callback. Why is that? is this a bug or is it meant to be like 
that by design?

Specifically speaking, the render method of the View class triggers the 
callbacks like this:

*464 *$this->getEventManager()->dispatch(new CakeEvent('View.beforeRender', 
$this, array($viewFileName)));
*465 *$this->Blocks->set('content', $this->_render($viewFileName));
*466 *$this->getEventManager()->dispatch(new CakeEvent('View.afterRender', 
$this, array($viewFileName)));
Whereas JsonView->render() will just return the $content without triggering 
the callbacks. 

I'm on version 2.1.3, btw.

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.


Reply via email to