Skip to content

Instantly share code, notes, and snippets.

@tatma
Last active August 8, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatma/35496164f4154eddffc93d8d0e9bf863 to your computer and use it in GitHub Desktop.
Save tatma/35496164f4154eddffc93d8d0e9bf863 to your computer and use it in GitHub Desktop.
Creazione della rotta
<?php
// ...previous content
/**
* @Route("/random/{max}", name="random")
*/
public function random($max = 10)
{
$randomNumber = random_int(0, $max);
return $this->render('Default/random.html.twig', [
'randomNumber' => $randomNumber
]);
}
<!DOCTYPE html>
<html>
<head>
<title>random Zombie Process</title>
</head>
<body>
Numero random generato: {{ randomNumber }}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment