Skip to content

Instantly share code, notes, and snippets.

@saro0h
Created October 6, 2014 13:10
Show Gist options
  • Save saro0h/9feafe08232d7509c35e to your computer and use it in GitHub Desktop.
Save saro0h/9feafe08232d7509c35e to your computer and use it in GitHub Desktop.
Controller
<?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,
);
}
}
@Tydesson
Copy link

Tydesson commented Oct 6, 2014

C'est cool !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment