Skip to content

Instantly share code, notes, and snippets.

View ollo-ride-nico's full-sized avatar

ollo-ride-nico

View GitHub Profile
<?php
/**
* Created by Nicolas Dirollo.
* Date: 13/01/2019
* Time: 19:06
* @package Symfony
* @author Nicolas Dirollo
* @copyright 2019 ND
* @license *
*/
<?php
/**
* Created by Nicolas Dirollo.
* Date: 13/01/2019
* Time: 19:02
* @package Symfony
* @author Nicolas Dirollo
* @copyright 2019 ND
* @license *
*/
<?php
/**
* Created by Nicolas Dirollo.
* Date: 13/01/2019
* Time: 18:57
* @package Symfony
* @author Nicolas Dirollo
* @copyright 2019 ND
* @license *
*/
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=a006eea95fd0d269b1e6f41041f37847
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-bundle ###
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
App\EventListener\VideoUploadListener:
tags:
- { name: kernel.event_listener, event: video.validated_upload }
// Event
namespace App\Service;
use App\Entity\Video;
use Symfony\Component\EventDispatcher\Event;
class VideoChangementEvent extends Event
{
const NAME = 'video.validated_upload';
class UpdateTrickController extends Controller
{
public function __invoke($id, Request $request)
{
// On récupère le trick à modifier
$updateTrick = $this->getDoctrine()
->getManager()
->getRepository('App:Tricks')
->find($id);
<div class="container-fluid">
<div class="row well">
<div class="form-group col-md-8">
{{ form_start(form) }}
<h3>Modifier le nom:</h3>
{{ form_widget(form.nom, {'attr': {'class': 'form-control'}}) }}
// Ma vue update Trick
<div class="container-fluid">
<div class="row well">
<div class="form-group col-md-8">
{{ form_start(form) }}
<h3>Modifier le nom:</h3>