Created
October 6, 2014 13:10
-
-
Save saro0h/9feafe08232d7509c35e to your computer and use it in GitHub Desktop.
Controller
This file contains 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 Acme\TrainingBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
class DefaultController extends Controller | |
{ | |
/** | |
* @Route("/users") | |
* @Template() | |
*/ | |
public function indexAction($name) | |
{ | |
$user1 = new \StdClass(); | |
$user1->name = 'Jane'; | |
$user1->lastname = 'Williams'; | |
$user1->biography = '<strong>Lorem</strong> ipsum <em>dolor</em>.'; | |
$user1->age = 45; | |
$user1->friends = array(); | |
$user2 = array( | |
'name' => 'John', | |
'lastname' => 'Smith', | |
'biography' => '<h2>Sit amet</h2> dolorem ipsum.', | |
'age' => 17, | |
'friends' => array( | |
$user1, | |
array('name' => 'Michael', 'lastname' => 'Brown', 'age' => 16), | |
array('name' => 'Robert', 'lastname' => 'Miller', 'age' => 27), | |
), | |
); | |
$order = array( | |
'totalWithoutTaxes' => 19.99, | |
'taxRate' => 0.20, | |
'paymentMethod' => 'credit_card', | |
'creditCardNumber' => '4400221234567890', | |
); | |
return array( | |
'user1' => $user1, | |
'user2' => $user2, | |
'order' => $order, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
C'est cool !