Skip to content

Instantly share code, notes, and snippets.

tatma

Block or report user

Report or block tatma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tatma
tatma / pizza.html.twig
Last active Aug 8, 2018
Creazione di /templates/Default/pizza.html.twig
View pizza.html.twig
<!DOCTYPE html>
<html>
<head>
<title>pizzeria Zombie Process</title>
</head>
<body>
Ciao, sono {{ name }}! La mia pizza preferita è la {{ pizza }}
</body>
</html>
@tatma
tatma / DefaultController.php
Last active Aug 8, 2018
Creazione della rotta
View DefaultController.php
<?php
// ...previous content
/**
* @Route("/random/{max}", name="random")
*/
public function random($max = 10)
{
$randomNumber = random_int(0, $max);
@tatma
tatma / pizza.html.twig
Last active Aug 8, 2018
pizza.html.twig eredita da base.html.twig
View pizza.html.twig
{% extends "base.html.twig" %}
{% block title %}pizzeria Zombie Process{% endblock %}
{% block content %}Ciao, sono {{ name }}! La mia pizza preferita è la {{ pizza }}{% endblock %}
@tatma
tatma / base.html.twig
Last active Aug 8, 2018
Creazione del file base.html.twig e menu.html.twig
View base.html.twig
<!DOCTYPE html>
<html>
<head>
<title>
{% block title %}{% endblock %}
</title>
</head>
<body>
{% include "menu.html.twig" %}
@tatma
tatma / DefaultController.php
Last active Aug 13, 2018
dump degli oggetti Request e Response
View DefaultController.php
<?php
// /src/Controller/DefaultController.php
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@tatma
tatma / DefaultController.php
Last active Aug 13, 2018
Creazione del file DefaultController
View DefaultController.php
<?php
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
/**
@tatma
tatma / DefaultController.php
Last active Aug 15, 2018
Aggiungiamo la rotta 'pizza'
View DefaultController.php
<?php
// previous content
/**
* @Route("/pizza", name="pizza")
*/
public function pizza()
{
return $this->render('Default/pizza.html.twig', [
'name' => 'Antonio',
@tatma
tatma / default.html.twig
Last active Aug 15, 2018
Esempio delle varianti del ciclo for
View default.html.twig
{# Questo è un commento #}
{# Esempio N.1 #}
Lista degli impiegati:<br>
{% for employee in employees %}
{{ employee.name }}
{% else %}
Nessun impiegato trovato
{% endfor %}
@tatma
tatma / DefaultController.php
Created Aug 15, 2018
Action delle tre rotte /php, /symfony, /vue
View DefaultController.php
<?php
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
/**
* @Route("/php", name="php_page")
View symfony_page.html.twig
<!DOCTYPE html>
<html>
<head>
<title>Symfony 4</title>
</head>
<body>
<h1>Framework Symfony 4</h1>
<p>
You can’t perform that action at this time.