Created
          October 3, 2011 12:24 
        
      - 
      
- 
        Save codecowboy/1258990 to your computer and use it in GitHub Desktop. 
    controller
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| namespace Gymloop\ChallengeBundle\Controller; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| use Gymloop\CoreBundle\Entity\Challenge; | |
| use Gymloop\CoreBundle\Entity\ChallengeCoordinates; | |
| class DefaultController extends Controller | |
| { | |
| public function indexAction() | |
| { | |
| $user = $user = $this->get('security.context')->getToken()->getUser(); | |
| $challenge = $this->getDoctrine() | |
| ->getRepository('GymloopCoreBundle:Challenge') | |
| ->find(1); | |
| if(!$challenge) { | |
| throw $this->createNotFoundException('No challenge found'); | |
| } | |
| $coordinates = $challenge->getCoordinates(); | |
| return $this->render('GymloopChallengeBundle:Default:index.html.twig', array('challenge' => $challenge, 'coordinates'=> $coordinates->toArray())); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment