Timeline/TimelineBuilder.php
private function render(array $fetched, array $entitiesByType, $context, array $args)
    {
        //add results to a pretty array
        $timelineEntries = array();
        foreach ($fetched as $result) {
            $data = $this->getTemplateData(
                    $result['type'], 
                    $entitiesByType[$result['type']][$result['id']], //the entity
                    $context,
                    $args);
            $timelineEntry['date'] = new \DateTime($result['date']);
            $timelineEntry['template'] = $data['template'];
            $timelineEntry['template_data'] = $data['template_data'];
            
            $timelineEntries[] = $timelineEntry;
        }
        
        return $this->container->get('templating')
                ->render('ChillMainBundle:Timeline:index.html.twig', array(
                    'results' => $timelineEntries
                ));
        
    }
private function render(array $fetched, array $entitiesByType, $context, array $args)
    {
        //add results to a pretty array
        $timelineEntries = array();
        foreach ($fetched as $result) {
            $data = $this->getTemplateData(
                    $result['type'], 
                    $entitiesByType[$result['type']][$result['id']], //the entity
                    $context,
                    $args);
            $timelineEntry['date'] = new \DateTime($result['date']);
            $timelineEntry['template'] = $data['template'];
            $timelineEntry['template_data'] = $data['template_data'];
            
            $timelineEntries[] = $timelineEntry;
        }
        
        return $this->container->get('templating')
                ->render('ChillMainBundle:Timeline:index.html.twig', array(
                    'results' => $timelineEntries
                ));
        
    }
private function render ( array $ fetched , array $ entitiesByType , $ context , array $ args ) { //add results to a pretty array $ timelineEntries = array ( ) ; foreach ( $ fetched as $ result ) { $ data = $ this -> getTemplateData ( $ result [ 'type' ] , $ entitiesByType [ $ result [ 'type' ] ] [ $ result [ 'id' ] ] , //the entity $ context , $ args ) ; $ timelineEntry [ 'date' ] = new \ DateTime ( $ result [ 'date' ] ) ; $ timelineEntry [ 'template' ] = $ data [ 'template' ] ; $ timelineEntry [ 'template_data' ] = $ data [ 'template_data' ] ; $ timelineEntries [ ] = $ timelineEntry ; } return $ this -> container -> get ( 'templating' ) -> render ( 'ChillMainBundle:Timeline:index.html.twig' , array ( 'results' => $ timelineEntries ) ) ; }
render the timeline as HTML

@param array $fetched
@param array $entitiesByType
@param string $context
@param mixed[] $args
@return string the HTML representation of the timeline
render the timeline as HTML