Skip to content

Instantly share code, notes, and snippets.

@magnusnordlander
Created September 11, 2011 14:48
Show Gist options
  • Save magnusnordlander/1209677 to your computer and use it in GitHub Desktop.
Save magnusnordlander/1209677 to your computer and use it in GitHub Desktop.
Progressive
<?php
class ProgressiveController
{
public function progressiveAction($some_id)
{
$response = new ProgressiveResponse();
$response->setHead("Some static data (maybe from twig), or an ESI tag, or whatever");
$response->setBodyClosure(function($response) {
heavyProcessing();
$response->setBody("Other data");
});
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment