Hello,
As a result from #252 and the last parapgraph of the wiki wiki:AjaxAndJSON I'm asking the best way to reduce the view call while doing AJAX/JSON actions. In this configuration rendering through a view is useless as just sending the X-JSON header is enough. So we can reduce execution time and avoid writting xxSuccess.php template for each AJAX/JSON call. I edited a patch I think is the "cleaner" let me know if we can improove it.
Thanks
patch for sfExecutionFilter.class.php:
114,120c114
< if ($viewName == sfView::HEADER_ONLY){
< $filterChain->executionFilterDone();
<
< // execute next filter
< $filterChain->execute();
< }
< else if ($viewName != sfView::NONE)
---
> if ($viewName != sfView::NONE)
and in sfView.class.php:
44a45,49
>
> /**
> * skip view rendering, output header (fast JSON call)
> */
> const HEADER_ONLY = 'headerOnly';
This way we can have a very fast AJAX/response using the #252 enhancement.
Thanks