Advanced usage: example with Doctrine

That's not really an advanced topic, but the sample will be a bit hard to read (as it takes many files), so let's say it targets more experienced Symfony users.

In this demo, we're displaying a MyArray of MyElements, both persisted into the database. The MyArray entity only have an id and a name, and MyElement has id, MyArray's id and a value. This is quite the same as we seen in all demos, but persisted.

Array name:
Add an element...

Existing arrays:
Name Open Delete
gufc fucvuy Open Delete
xv Open Delete
___ ☘ Cela fonctionne â Open Delete
___ ☘ Cela fonctionne à Open Delete
___ Array with Elements ... Click Open to test loading Open Delete
__________________________________________ Open Delete
____________________________1 test Open Delete
____________________________1%20test Open Delete
_________coucou Open Delete
_________coucou------------------ Open Delete
_______aaaazz Open Delete
___%20%C3%83%C2%A2%C3%82%C2%98%C3%82%C2%98%20Cela%20fonctionne%20%C3%83 Open Delete
___%20%C3%83%C2%A2%C3%82%C2%98%C3%82%C2%98%20Cela%20fonctionne%20%C3%83%C2%A2%C3%82%C2%98%C3%82%C2%98 Open Delete
___%20%C3%83%C2%A2%C3%82%C2%98%C3%82%C2%98%20Cela%20fonctionne%20%C3%8334%D0%BD34%D0%BD Open Delete
___%20%C3%A2%C2%98%C2%98%20Cela%20fonctionne%20%C3%A2 Open Delete
___%20%E2%98%98%20Cela%20fonctionne%20%E2%98%98 Open Delete
_%C3%A8 Open Delete
_a_firra Open Delete
_Greeting Open Delete
---#i21ef661e2506d5d0e513dce166c17d49 Open Delete
---#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
---%23i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
---%23i27992875ec4286a24e569b1e015b0473 Open Delete
---%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
---%23ie025efbbb0738ed01a63b326c174233e Open Delete
!!!!sdsdsd Open Delete
() Open Delete
(orphée) Open Delete
(SELECT (CASE WHEN (6190=5092) THEN 'kjh' ELSE (SELECT 5092 UNION SELECT 3869) END)) Open Delete
&&&&&&&&&&& Open Delete
#456 Open Delete
#69 Open Delete
#72uuuu Open Delete
#AlgoSucks Open Delete
%231 Open Delete
%23AlgoSucks Open Delete
%23timowashere Open Delete
%25237233333#i21ef661e2506d5d0e513dce166c17d49 Open Delete
%25237233333#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
%25237233333#ie025efbbb0738ed01a63b326c174233e Open Delete
%252372uuuu#i5784b3886628c4362594ffa43547edb4 Open Delete
%252372uuuu#ibcac9f4c58199eeaa7ba5c7750b8434b Delete
%252372uuuu#ie025efbbb0738ed01a63b326c174233e Open Delete
%2525237233333%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
%2525237233333%23i27992875ec4286a24e569b1e015b0473 Open Delete
%2525237233333%23i5784b3886628c4362594ffa43547edb4 Open Delete
%25252372uuuu Open Delete
%25252372uuuu%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
%25252372uuuu%23i5784b3886628c4362594ffa43547edb4 Open Delete
%25252372uuuu%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
%25252391 Open Delete
%25253F%23i27992875ec4286a24e569b1e015b0473 Open Delete
%25253F%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
%2527 Open Delete
%2528orph%25C3%25A9e%2529 Open Delete
%253Csdsads Open Delete
%253F#i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
%253F#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
%25C3%25B1sfkjaldsa Open Delete
%27rtrt Open Delete
%28SELECT%20%28CASE%20WHEN%20%283158=3158%29%20THEN%20%27kjh%27%20ELSE%20%28SELECT%201437%20UNION%20SELECT%202166%29%20END%29%29 Open Delete
%3C%3Fphp%20echo%20%27%20i%20don%27t%20like%20it%20%27 Open Delete
%C3%83%C2%83%C3%82%C2%83%C3%83%C2%82%C3%82%C2%B1lkjlkj Open Delete
%C3%83%C2%B1sfkjaldsa Open Delete
%D1%82%D0%B5%D1%81%D1%82 Open Delete
< Open Delete
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<LETTRE GREC>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Open Delete
<script>alert('test')</script> Open Delete
<script>alert('test')</script>%n%n%n%n%n%n Open Delete
<script>alert('test')</script>%n%n%n%n%n%n<script>alert('test')</script>%n%n%n%n%n%n<script>alert('test')</script>%n%n%n%n%n%n<script>alert('test')</script>%n%n%n%n%n%n<script>alert('test')</script>%n%n%n%n%n%n<script>alert('test')</script>%n%n%n%n%n%n<sc Open Delete
<sdsads Open Delete
00000 Open Delete
001122334455 Open Delete
01233 Open Delete
10 Open Delete
1000-1 Open Delete
11#i5784b3886628c4362594ffa43547edb4 Open Delete
11#i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
11%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
11%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
11%23i5784b3886628c4362594ffa43547edb4 Open Delete
11%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
11%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
1111#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
1111#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
1111#ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
1111#ie025efbbb0738ed01a63b326c174233e Open Delete
1111%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
1111111111111111111111111111111111#i27992875ec4286a24e569b1e015b0473 Open Delete
1111111111111111111111111111111111#i5784b3886628c4362594ffa43547edb4 Open Delete
1111111111111111111111111111111111%23i5784b3886628c4362594ffa43547edb4 Open Delete
1111111111111111111111111111111111%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
1111111111111111111111111111111111%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
1121 Open Delete
123124 Open Delete
123333 Open Delete
12345 Open Delete
123blue Open Delete
1241 Open Delete
1aa Open Delete
222 Open Delete
2222 example Open Delete
2222%2520example Open Delete
222222 Open Delete
2344234 Open Delete
3 Open Delete
32 Open Delete
454 Open Delete
5 Open Delete
78 Open Delete
8 Open Delete
88 Open Delete
8889 Open Delete
8899 Open Delete
969 Open Delete
a Open Delete
☘ Cela fonctionne ☘ Open Delete
a Lorenz Open Delete
a%20Lorenz Open Delete
a2 Open Delete
aa Open Delete
Aaa Open Delete
aaaaa Open Delete
aaaaaaaaaaaaaa Open Delete
aaaaaaaaaaaaaa22 Open Delete
тест Open Delete
aaamine22222 Open Delete
aaamine22222#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
aaamine22222#i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
aaamine22222%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
aaamine22222%23i5784b3886628c4362594ffa43547edb4 Open Delete
aaamine22222%23ie025efbbb0738ed01a63b326c174233e Open Delete
ad Open Delete
adasdada Open Delete
adfadf%27A=0 Open Delete
AlgoSucks Open Delete
Alpha Open Delete
array%20new Open Delete
array%2520new Open Delete
Array2 Open Delete
articulo Open Delete
as Open Delete
asaasexample Open Delete
asD Open Delete
asd%20asd%20asd Open Delete
asdas Open Delete
asdasd Open Delete
asdasd#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
asdasd%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
asdasd%23i5784b3886628c4362594ffa43547edb4 Open Delete
asdasd%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
asdasd%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
asdasd%23ie025efbbb0738ed01a63b326c174233e Open Delete
asdasdadasd Open Delete
asdasdadasd#i21ef661e2506d5d0e513dce166c17d49 Open Delete
asdasdadasd#i27992875ec4286a24e569b1e015b0473 Open Delete
asdasdadasd#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
asdasdadasd#ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
asdasdadasd#ie025efbbb0738ed01a63b326c174233e Open Delete
asdasdadasd%23i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
asds Open Delete
az Open Delete
azerty Open Delete
azerty'A=0 Open Delete
azerty%27A=0 Open Delete
balala Open Delete
bam Open Delete
bbb Open Delete
bbbbbbbbbbbbbbbb Open Delete
bcvbcvb Open Delete
bjfhj#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
bjfhj#ie025efbbb0738ed01a63b326c174233e Open Delete
bjfhj%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
bjfhj%23i27992875ec4286a24e569b1e015b0473 Open Delete
bjfhj%23ie025efbbb0738ed01a63b326c174233e Open Delete
blah#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
blah#i21ef661e2506d5d0e513dce166c17d49 Open Delete
blah#i5784b3886628c4362594ffa43547edb4 Open Delete
blah#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
blah%23i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
blah%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
blah%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
blah%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
blah%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
born Open Delete
Caracas222 Open Delete
cdcdc Open Delete
Cela%20fonctionne%20pas Open Delete
Christos Open Delete
colombo Open Delete
cool Open Delete
crap Open Delete
cx<wc'A=0 Open Delete
D#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
D#i21ef661e2506d5d0e513dce166c17d49 Open Delete
D%20happy%202018 Open Delete
D%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
D%23i27992875ec4286a24e569b1e015b0473 Open Delete
D%23i5784b3886628c4362594ffa43547edb4 Open Delete
D%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
dadd Open Delete
das Open Delete
dasd Open Delete
dasdsa Open Delete
dasdsad Open Delete
dcdc Open Delete
dd Open Delete
delete_empty Open Delete
dfa#i21ef661e2506d5d0e513dce166c17d49 Open Delete
dfa#i27992875ec4286a24e569b1e015b0473 Open Delete
dfa#i5784b3886628c4362594ffa43547edb4 Open Delete
dfa#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
dfa%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
dfg Open Delete
dfty Open Delete
dfvds Open Delete
diarill Open Delete
drgd Open Delete
dsadsadd Open Delete
dsds Open Delete
e Open Delete
eeeeee Open Delete
ejemplito 2 Open Delete
ejemplo 2017 Open Delete
ejemplo 2017-11-23 Open Delete
ejemplo%202 Open Delete
ejemplo%202017-11-23 Open Delete
eqweqwe Open Delete
er Open Delete
erwgfuıgj8hlı Open Delete
erwgfuıgj8hlı Open Delete
ewe Open Delete
example Open Delete
example Radu Open Delete
example%2520exam Open Delete
example+exam Open Delete
example123 Open Delete
example123#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
example123#i21ef661e2506d5d0e513dce166c17d49 Open Delete
example123#i5784b3886628c4362594ffa43547edb4 Open Delete
example123#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
example123%23i27992875ec4286a24e569b1e015b0473 Open Delete
example123%23i5784b3886628c4362594ffa43547edb4 Open Delete
example2 Open Delete
example22222222222222 Open Delete
exampleasd Open Delete
exampleasfsafa Open Delete
exampleasfsafasf Open Delete
exampleasfsafasf%23ie025efbbb0738ed01a63b326c174233e Open Delete
exampled Open Delete
examplee Open Delete
exampleeaze Open Delete
exampleede Open Delete
examplemmm Open Delete
examplenhnhd Open Delete
exampleqqqq Open Delete
exampleqzd Open Delete
examplertyrtyrty Open Delete
exampleRW Open Delete
examplesa;fs;af;sfsf Open Delete
examplesadfasfasdf Open Delete
examplesafs Open Delete
examplesafs;af;sfsf Open Delete
exampletestsf sdf sd sd Open Delete
Existing arr Open Delete
Existing arrays: Open Delete
Existing%20arrays: Open Delete
Existing%2520arrays: Open Delete
fasdfasf Open Delete
fat Open Delete
fdf Open Delete
fdf#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
fdf#i21ef661e2506d5d0e513dce166c17d49 Open Delete
fdf#i5784b3886628c4362594ffa43547edb4 Open Delete
fdf%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
fdf%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
fdf%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
fdg Open Delete
fdgfdgfdgfdgfd Open Delete
fdgfgsdf Open Delete
ffff Open Delete
fgfdg Open Delete
fgfdgdgdf Open Delete
fghjk, Open Delete
fgjgh Open Delete
fgt Open Delete
firrra Open Delete
foo Open Delete
Fora Bolsonaro Open Delete
fr Open Delete
fro Open Delete
Fruits Open Delete
fsdfsdf Open Delete
fuck you Open Delete
gdfg#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
gdfg#i27992875ec4286a24e569b1e015b0473 Open Delete
gdfg%23i5784b3886628c4362594ffa43547edb4 Open Delete
gdfg%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
geht%20nicht Open Delete
gfdgdf Open Delete
gg Open Delete
ggg Open Delete
ghfhgfg Open Delete
ghj Open Delete
ghjk Open Delete
ghjk#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
ghjk#i27992875ec4286a24e569b1e015b0473 Open Delete
ghjk#ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
ghjk%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
ghjk%23i5784b3886628c4362594ffa43547edb4 Open Delete
ghjk%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
ghk Open Delete
ghkjgykg Open Delete
Ghy Open Delete
Group B Open Delete
Group%252BC Open Delete
Group%252BC%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
Group%252BC%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
Group%2BC#i27992875ec4286a24e569b1e015b0473 Open Delete
Group%2BC#i5784b3886628c4362594ffa43547edb4 Open Delete
Group+C Open Delete
gtgt Open Delete
gufc fucvuy dd Open Delete
gufc%20fucvuy Open Delete
gufc%20fucvuy%20dd Open Delete
hahah Open Delete
Hello%20world Open Delete
hellowrld Open Delete
heof Open Delete
HEYY :D Open Delete
HEYY%2520:D#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
HEYY%2520:D#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
HEYY%2520:D#i27992875ec4286a24e569b1e015b0473 Open Delete
HEYY%2520:D#i5784b3886628c4362594ffa43547edb4 Open Delete
HEYY%252520:D%23i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
HEYY%252520:D%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
HEYY%252520:D%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
HEYY%252520:D%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
hg Open Delete
hgjgjh Open Delete
hh Open Delete
hhh Open Delete
hhmm Open Delete
hjh Open Delete
hrthrh Open Delete
iii Open Delete
ilesh Open Delete
interest Open Delete
iooi Open Delete
itemList Open Delete
iuy Open Delete
jghjghjgj Open Delete
jhj Open Delete
jj Open Delete
jk Open Delete
jkjk Open Delete
kaas Open Delete
kappa Open Delete
kfhk Open Delete
khj#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
khj#i27992875ec4286a24e569b1e015b0473 Open Delete
khj#i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
khj#ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
khj#ie025efbbb0738ed01a63b326c174233e Open Delete
khj%23i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
khj%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
khj%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
kjh AND 2060=2060 Open Delete
kjh AND 2060=2060-- Qbuj Open Delete
kjh AND 2171=2112-- yWqk Open Delete
kjh AND 2675=9406 Open Delete
kjh AND 2935=5884-- JseU Open Delete
kjh AND 5825=4111 Open Delete
kjh AND 7390 IN (SELECT (CHAR(113)+CHAR(106)+CHAR(106)+CHAR(118)+CHAR(113)+(SELECT (CASE WHEN (7390=7390) THEN CHAR(49) ELSE CHAR(48) END))+CHAR(113)+CHAR(113)+CHAR(122)+CHAR(120)+CHAR(113))) Open Delete
kjh AND 7390 IN (SELECT (CHAR(113)+CHAR(106)+CHAR(106)+CHAR(118)+CHAR(113)+(SELECT (CASE WHEN (7390=7390) THEN CHAR(49) ELSE CHAR(48) END))+CHAR(113)+CHAR(113)+CHAR(122)+CHAR(120)+CHAR(113)))-- iTwS Open Delete
kjh AND 7426=7426 Open Delete
kjh AND 8611=(SELECT UPPER(XMLType(CHR(60)||CHR(58)||CHR(113)||CHR(106)||CHR(106)||CHR(118)||CHR(113)||(SELECT (CASE WHEN (8611=8611) THEN 1 ELSE 0 END) FROM DUAL)||CHR(113)||CHR(113)||CHR(122)||CHR(120)||CHR(113)||CHR(62))) FROM DUAL)-- iQEG Open Delete
kjh AND 9650=6116 Open Delete
kjh AND 9667 IN (SELECT (CHAR(113)+CHAR(122)+CHAR(107)+CHAR(120)+CHAR(113)+(SELECT (CASE WHEN (9667=9667) THEN CHAR(49) ELSE CHAR(48) END))+CHAR(113)+CHAR(106)+CHAR(107)+CHAR(122)+CHAR(113)))-- IHOP Open Delete
kjh AND EXTRACTVALUE(5914,CONCAT(0x5c,0x716a6a7671,(SELECT (ELT(5914=5914,1))),0x71717a7871)) Open Delete
kjh AND EXTRACTVALUE(7241,CONCAT(0x5c,0x717a6b7871,(SELECT (ELT(7241=7241,1))),0x716a6b7a71))-- fAHu Open Delete
kjh ORDER BY 1-- MwCf Open Delete
kjh,),..('") Open Delete
kjh') AND 1448=9534 AND ('TzXm'='TzXm Open Delete
kjh') AND 2060=2060 AND ('JwAk'='JwAk Open Delete
kjh') AND 6019=4131 AND ('fWIB'='fWIB Open Delete
kjh') AND 9667 IN (SELECT (CHAR(113)+CHAR(122)+CHAR(107)+CHAR(120)+CHAR(113)+(SELECT (CASE WHEN (9667=9667) THEN CHAR(49) ELSE CHAR(48) END))+CHAR(113)+CHAR(106)+CHAR(107)+CHAR(122)+CHAR(113))) AND ('ixOS'='ixOS Open Delete
kjh') AND EXTRACTVALUE(7241,CONCAT(0x5c,0x717a6b7871,(SELECT (ELT(7241=7241,1))),0x716a6b7a71)) AND ('oZSA'='oZSA Open Delete
kjh') ORDER BY 1-- osYG Open Delete
kjh'FIFazt<'">kJJxrd Open Delete
kjh'vKJjiT<'">dxPGFb Open Delete
kjh) AND 9930=6330 AND (9057=9057 Open Delete
kjh) AND EXTRACTVALUE(7241,CONCAT(0x5c,0x717a6b7871,(SELECT (ELT(7241=7241,1))),0x716a6b7a71)) AND (6110=6110 Open Delete
kjh%20AND%20EXTRACTVALUE%287241,CONCAT%280x5c,0x717a6b7871,%28SELECT%20%28ELT%287241=7241,1%29%29%29,0x716a6b7a71%29%29 Open Delete
kjh%27%20AND%202060=2060%20AND%20%27JKZh%27=%27JKZh Open Delete
kjh%27%29%20AND%209667%20IN%20%28SELECT%20%28CHAR%28113%29+CHAR%28122%29+CHAR%28107%29+CHAR%28120%29+CHAR%28113%29+%28SELECT%20%28CASE%20WHEN%20%289667=9667%29%20THEN%20CHAR%2849%29%20ELSE%20CHAR%2848%29%20END%29%29+CHAR%28113%29+CHAR%28106%29+CHAR%28107% Open Delete
kjh%29%20AND%209930=6330%20AND%20%289057=9057 Open Delete
kjkjkj Open Delete
kkik Open Delete
kkk Open Delete
kkk#i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
kkk%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
kkk%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
kkk%23ie025efbbb0738ed01a63b326c174233e Open Delete
klklklkl Open Delete
kpok Open Delete
kpok%C3%82%C2%B4p Open Delete
kpok´p Open Delete
lkjlkj Open Delete
ll Open Delete
Lorenz du Open Delete
Lorenz du stinker Open Delete
Lorenz%20du%20 Open Delete
Lundi Open Delete
medicion%202 Open Delete
miTest Open Delete
mjn Open Delete
mkmkmk Open Delete
moiGHOY Open Delete
moiGHOY - Resources/views/Advanced/doctrine-them Open Delete
mon exemple Open Delete
mon tableau Open Delete
mon%20putain%20de%20tableau Open Delete
mon%2520putain%2520de%2520tableau Open Delete
mon%2520tableau Open Delete
my_array Open Delete
New_test_2017-03_03 Open Delete
new%20test Open Delete
new%2520test Open Delete
nmn#i27992875ec4286a24e569b1e015b0473 Open Delete
nmn#ie025efbbb0738ed01a63b326c174233e Open Delete
nmn%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
nnn Open Delete
nnnnn Open Delete
Numeros de prueba Open Delete
Numeros%20de%20prueba Open Delete
o Open Delete
o%C3%83%C2%83%C3%82%C2%84%C3%83%C2%82%C3%82%C2%B1 Open Delete
o%C3%84%C2%B1 Open Delete
oı Open Delete
oı Open Delete
oezjfez Open Delete
ordersCollection Open Delete
Ouiiiiiiiiiiii Open Delete
Ouiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii Open Delete
Ouiiiiiiiiiiiiiiiiiiiiiiiilul Open Delete
perses#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
perses%23i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
perses%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
perses%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
po Open Delete
pppppii#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
pppppii#i5784b3886628c4362594ffa43547edb4 Open Delete
pppppii%23i27992875ec4286a24e569b1e015b0473 Open Delete
pppppii%23ie025efbbb0738ed01a63b326c174233e Open Delete
pppppp Open Delete
Premier element de test Open Delete
Product Open Delete
project%25201 Open Delete
project+1 Open Delete
qe Open Delete
Qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwweeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerrrrrrr Open Delete
qsd Open Delete
qsdfqsdf Open Delete
qwe Open Delete
qwehgnhngh Open Delete
qwerqwerqw Open Delete
qwert Open Delete
qwery2 Open Delete
rdfgdf Open Delete
rerwrer Open Delete
resr Open Delete
RET Open Delete
rrrr Open Delete
rrrr#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
rrrr#ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
rrrr#ie025efbbb0738ed01a63b326c174233e Open Delete
rrrr%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
rrrr%23ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
rtr Open Delete
sa Open Delete
saassa Open Delete
salut les gens Open Delete
salut%20les%20gens Open Delete
sam Open Delete
samArray Open Delete
scts Open Delete
sd Open Delete
sdasd Open Delete
sdasda Open Delete
sdasdafs Open Delete
sdfsdfsd Open Delete
sdsd'A=0 Open Delete
seeme#i1097c8b84b58a65ed6ec7b4f0da3ab67 Open Delete
seeme#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
seeme%23ie025efbbb0738ed01a63b326c174233e Open Delete
sfsdfsd Open Delete
someNewArray#i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
someNewArray#i5784b3886628c4362594ffa43547edb4 Open Delete
someNewArray%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
someNewArray%23i5784b3886628c4362594ffa43547edb4 Open Delete
someNewArray%23i8c18088ea4d8dd4d6e5e986bceed35da Open Delete
someNewArray%23ie025efbbb0738ed01a63b326c174233e Open Delete
sssss Open Delete
suck my co Open Delete
suck%2520my%2520cock%2520fgts Open Delete
Ta mere la grosse choin Open Delete
Ta mere la grosse tchoin Open Delete
Ta%20mere%20la Open Delete
Ta%20mere%20la%20grosse%20choin Open Delete
Ta%2520mere%2520la%2520grosse%2520choin#ibcac9f4c58199eeaa7ba5c7750b8434b Open Delete
Ta%2520mere%2520la%2520grosse%2520choin#ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
Ta%252520mere%252520la%252520grosse%252520choin%23i1dcd1cbb0d8eeb1fd3a32dc2aa9c8013 Open Delete
Ta%252520mere%252520la%252520grosse%252520choin%23i21ef661e2506d5d0e513dce166c17d49 Open Delete
Ta%252520mere%252520la%252520grosse%252520choin%23i27992875ec4286a24e569b1e015b0473 Open Delete
terst Open Delete
test--1 Open Delete
test%20array Open Delete
test34 Open Delete
Teste Open Delete
teste2 Open Delete
testname Open Delete
testsetse Open Delete
tesy Open Delete
Thais Open Delete
the Open Delete
the test Open Delete
this is an Open Delete
trololo Open Delete
try01 Open Delete
tset Open Delete
tttttz Open Delete
tyrtyrtr Open Delete
ui Open Delete
ukh Open Delete
undefined Open Delete
Vai%20que%20da Open Delete
vcbbc Open Delete
vffv Open Delete
Volta Dilma Fo Open Delete
Volta%252 Open Delete
Volta%2520Di Open Delete
Volta%2520Dilma%2520Fo Open Delete
Volta%2520Dilma%2520Fora% Open Delete
Volta%2520Dilma%2520Fora%2520Temer#i2 Open Delete
Volta%252520Dilma%252520Fora%252520Temer%23i2 Open Delete
Volta%252520Dilma%252520Fora%252520Temer%23i21ef661e2506d5d0e513dce16 Open Delete
Volta%252520Dilma%252520Fora%252520Temer%23ic3ee8978c60737ab5d058b5a3f6a1b09 Open Delete
VRE Open Delete
vv Open Delete
wasda Open Delete
why%20doctrine Open Delete
why%20doctrine%20on%20delete%20not%20work Open Delete
Woop%2520wooop Open Delete
wqeqe Open Delete
wsh%20yannito Open Delete
ww Open Delete
wxc<wxc Open Delete
xd Open Delete
xvvsdf Open Delete
xy Open Delete
xzcvxcv Open Delete
yiktikrtr Open Delete
yoyoy Open Delete
yut Open Delete
yytutyutyu Open Delete
zizizizizi Open Delete
File: Base/BaseController.php
<?php

namespace Fuz\AppBundle\Base;

use Fuz\AppBundle\Entity\Value;
use Fuz\AppBundle\Form\ValueType;
use Fuz\QuickStartBundle\Base\BaseController as QuickStartBase;
use Symfony\Component\Form\Extension\Core\Type;
use Symfony\Component\HttpFoundation\Request;

class BaseController extends QuickStartBase
{
    protected function createContextSample(Request $request, $name = 'form', $values = ['a', 'b', 'c'])
    {
        $data = ['values' => $values];

        $form = $this
           ->get('form.factory')
           ->createNamedBuilder($name, Type\FormType::class, $data)
           ->add('values', Type\CollectionType::class, [
               'entry_type'    => Type\TextType::class,
               'label'         => 'Add, move, remove values and press Submit.',
               'entry_options' => [
                   'label' => 'Value',
               ],
               'allow_add'    => true,
               'allow_delete' => true,
               'prototype'    => true,
               'attr'         => [
                   'class' => "{$name}-collection",
               ],
           ])
           ->add('submit', Type\SubmitType::class)
           ->getForm()
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();
        }

        return [
            $name         => $form->createView(),
            "{$name}Data" => $data,
        ];
    }

    protected function createAdvancedContextSample(Request $request, $name = 'advancedForm')
    {
        $a = new Value('a');
        $b = new Value('b');
        $c = new Value('c');

        $data = ['values' => [$a, $b, $c]];

        $form = $this
           ->get('form.factory')
           ->createNamedBuilder($name, Type\FormType::class, $data)
           ->add('values', Type\CollectionType::class, [
               'entry_type'   => ValueType::class,
               'label'        => 'Add, move, remove values and press Submit.',
               'allow_add'    => true,
               'allow_delete' => true,
               'prototype'    => true,
               'required'     => false,
               'attr'         => [
                   'class' => "{$name}-collection",
               ],
           ])
           ->add('submit', Type\SubmitType::class)
           ->getForm()
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();
        }

        return [
            $name         => $form->createView(),
            "{$name}Data" => $data,
        ];
    }
}
File: Base/BaseController.php
File: Controller/AdvancedController.php
<?php

namespace Fuz\AppBundle\Controller;

use Fuz\AppBundle\Base\BaseController;
use Fuz\AppBundle\Entity\Address;
use Fuz\AppBundle\Entity\Addresses;
use Fuz\AppBundle\Entity\Fancy;
use Fuz\AppBundle\Entity\FancyCollection;
use Fuz\AppBundle\Entity\Value;
use Fuz\AppBundle\Form\AddressesType;
use Fuz\AppBundle\Form\FancyCollectionType;
use Fuz\AppBundle\Form\MyArrayType;
use Fuz\AppBundle\Form\ValueType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Form\Extension\Core\Type;
use Symfony\Component\HttpFoundation\Request;

/**
 * @Route("/advanced")
 */
class AdvancedController extends BaseController
{
    /**
     * Advanced usage
     *
     * You can reference your form collection in the view, instead of
     * putting a selector in the form type.
     *
     * @Route("/mvcCompliance", name="mvcCompliance")
     * @Template()
     */
    public function mvcComplianceAction(Request $request)
    {
        $data = ['values' => ['a', 'b', 'c']];

        $form = $this
           ->createFormBuilder($data)
           ->add('values', Type\CollectionType::class, [
               'entry_type'    => Type\TextType::class,
               'label'         => 'Add, move, remove values and press Submit.',
               'entry_options' => [
                   'label' => 'Value',
               ],
               'allow_add'    => true,
               'allow_delete' => true,
               'prototype'    => true,
               'required'     => false,
//                   'attr' => array (
//                           'class' => 'my-selector', <--- Not MVC compliant!
//                   ),
           ])
           ->add('submit', Type\SubmitType::class)
           ->getForm()
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();
        }

        return [
            'form' => $form->createView(),
            'data' => $data,
        ];
    }

    /**
     * Advanced usage
     *
     * A custom form theme helps define button's layout and positions as and where you want.
     *
     * @Route("/customFormTheme", name="customFormTheme")
     * @Template()
     */
    public function customFormThemeAction(Request $request)
    {
        $data = ['values' => [new Value('a'), new Value('b'), new Value('c')]];

        $form = $this
           ->createFormBuilder($data)
           ->add('values', Type\CollectionType::class, [
               'entry_type'   => ValueType::class,
               'label'        => 'Add, move, remove values and press Submit.',
               'allow_add'    => true,
               'allow_delete' => true,
               'prototype'    => true,
               'required'     => false,
               'attr'         => [
                   'class' => 'collection',
               ],
           ])
           ->add('submit', Type\SubmitType::class)
           ->getForm()
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();
        }

        return [
            'form' => $form->createView(),
            'data' => $data,
        ];
    }

    /**
     * Advanced usage
     *
     * Same demo as above, but with the add button located at the bottom of
     * the form instead of close to each field.
     *
     * @Route("/customFormThemeAddBottom", name="customFormThemeAddBottom")
     * @Template()
     */
    public function customFormThemeAddBottomAction(Request $request)
    {
        return $this->customFormThemeAction($request);
    }

    /**
     * Advanced usage
     *
     * Collection of collections are useful on the most dynamic forms, and a good
     * way to test if the plugin is working as expected too.
     *
     * @Route("/collectionOfCollections", name="collectionOfCollections")
     * @Template()
     */
    public function collectionOfCollectionsAction(Request $request)
    {
        $data = [
            'collections' => [
                [new Value('a'), new Value('b'), new Value('c')],
                [new Value('d'), new Value('e'), new Value('f')],
                [new Value('g'), new Value('h'), new Value('i')],
            ],
        ];

        $form = $this
           ->get('form.factory')
           ->createNamedBuilder('form', Type\FormType::class, $data)
           ->add('collections', Type\CollectionType::class, [
               'entry_type'    => Type\CollectionType::class,
               'label'         => 'Add, move, remove collections',
               'entry_options' => [
                   'entry_type'    => ValueType::class,
                   'label'         => 'Add, move, remove values',
                   'entry_options' => [
                       'label' => 'Value',
                   ],
                   'allow_add'      => true,
                   'allow_delete'   => true,
                   'prototype'      => true,
                   'prototype_name' => '__children_name__',
                   'attr'           => [
                       'class' => 'child-collection',
                   ],
               ],
               'allow_add'      => true,
               'allow_delete'   => true,
               'prototype'      => true,
               'prototype_name' => '__parent_name__',
               'attr'           => [
                   'class' => 'parent-collection',
               ],
           ])
           ->add('submit', Type\SubmitType::class)
           ->getForm()
        ;

        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();
        }

        return [
            'form' => $form->createView(),
            'data' => $data,
        ];
    }

    /**
     * Advanced usage
     *
     * Looks like there are weird behaviours with Doctrine:
     * https://github.com/ninsuo/symfony-collection/issues/7
     * Let's test that live!
     *
     * ... hmm, doesn't look bad anyway
     *
     * @Route(
     *      "/usageWithDoctrine/{name}",
     *      name = "usageWithDoctrine",
     *      defaults = {
     *          "name" = "example"
     *      }
     * )
     * @Template()
     */
    public function usageWithDoctrineAction(Request $request, $name)
    {
        $repo = $this->getDoctrine()->getRepository('FuzAppBundle:MyArray');

        $data = $repo->findOneByName($name);
        if (is_null($data)) {
            $data = $repo->create($name);
        }

        $form = $this->createForm(MyArrayType::class, $data);
        $form->handleRequest($request);

        $form->get('save')->isClicked() && $form->isValid() && $repo->save($data);

        return [
            'names' => $repo->getArrayNames(),
            'form'  => $form->createView(),
            'data'  => $data,
        ];
    }

    /**
     * Related to usageWithDoctrine demo
     *
     * @Route(
     *      "/usageWithDoctrineDelete/{name}",
     *      name = "usageWithDoctrineDelete"
     * )
     */
    public function usageWithDoctrineDeleteAction(Request $request, $name)
    {
        $repo = $this->getDoctrine()->getRepository('FuzAppBundle:MyArray');
        if (!is_null($data = $repo->findOneByName($name))) {
            $repo->delete($data);
        }

        return $this->forward('FuzAppBundle:Advanced:usageWithDoctrine', [
            'name' => 'example',
        ]);
    }

    /**
     * A form having a theme and containing several fields
     *
     * @Route(
     *      "/formHavingSeveralFields",
     *      name = "formHavingSeveralFields"
     * )
     * @Template()
     */
    public function formHavingSeveralFieldsAction(Request $request)
    {
        $address = new Address();
        $address->setName('Mickael Steller');
        $address->setCompany('fuz.org');
        $address->setStreet('41 rue de la Paix');
        $address->setPostalcode('75002');
        $address->setCity('Paris');
        $address->setCountry('France');

        $addresses = new Addresses();
        $addresses->getAddresses()->add($address);

        $form = $this->createForm(AddressesType::class, $addresses);
        if ($request->isMethod('POST')) {
            $form->handleRequest($request);
        }

        return [
            'form' => $form->createView(),
            'data' => $addresses,
        ];
    }

    /**
     * Another example of form theme
     *
     * @Route(
     *      "/fancyFormTheme",
     *      name = "fancyFormTheme"
     * )
     * @Template()
     */
    public function fancyFormThemeAction(Request $request)
    {
        $fancyCollection = new FancyCollection();

        for ($i = 0; $i < 3; $i++) {
            $fancy = new Fancy();
            $fancyCollection->getFancyCollection()->add($fancy);
        }

        $form = $this->createForm(FancyCollectionType::class, $fancyCollection);

        $form->handleRequest($request);
        if ($form->isValid()) {
            $data = $form->getData();
        }

        return [
            'form' => $form->createView(),
            'data' => $fancyCollection,
        ];
    }
}
File: Controller/AdvancedController.php
File: Entity/MyArray.php
<?php

namespace Fuz\AppBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * MyArray
 *
 * @ORM\Table(
 *      name="my_array",
 *      uniqueConstraints={@ORM\UniqueConstraint(name="name_idx", columns={"name"})}
 * )
 * @ORM\Entity(repositoryClass="Fuz\AppBundle\Repository\MyArrayRepository")
 */
class MyArray
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    protected $name;

    /**
     * @var ArrayCollection
     *
     * @ORM\OneToMany(targetEntity="MyElement", mappedBy="array", cascade={"all"}, orphanRemoval=true)
     */
    protected $elements;

    public function __construct()
    {
        $this->elements = new ArrayCollection();
    }

    public function getId()
    {
        return $this->id;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    public function getElements()
    {
        return $this->elements;
    }
}
File: Entity/MyArray.php
File: Entity/MyElement.php
<?php

namespace Fuz\AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * MyElement
 *
 * @ORM\Table(name="my_element"),
 * @ORM\Entity
 */
class MyElement
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var MyArray
     *
     * @ORM\ManyToOne(targetEntity="MyArray", inversedBy="elements")
     * @ORM\JoinColumn(name="my_array_id", referencedColumnName="id")
     */
    protected $array;

    /**
     * @var string
     *
     * @ORM\Column(name="value", type="string", length=255)
     */
    protected $value;

    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    public function getId()
    {
        return $this->id;
    }

    public function setArray(MyArray $array)
    {
        $this->array = $array;

        return $this;
    }

    public function getArray()
    {
        return $this->array;
    }

    public function setValue($value)
    {
        $this->value = $value;

        return $this;
    }

    public function getValue()
    {
        return $this->value;
    }
}
File: Entity/MyElement.php
File: Form/MyArrayType.php
<?php

namespace Fuz\AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class MyArrayType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name', TextType::class, [
                'label' => 'Array name:',
        ]);

        $builder->add('elements', CollectionType::class, [
            'label'        => 'Add an element...',
            'entry_type'   => MyElementType::class,
            'allow_add'    => true,
            'allow_delete' => true,
            'prototype'    => true,
            'required'     => false,
            'by_reference' => true,
            'delete_empty' => true,
            'attr'         => [
                'class' => 'doctrine-sample',
            ],
        ]);

        $builder->add('save', SubmitType::class, [
                'label' => 'Save this array',
        ]);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => 'Fuz\AppBundle\Entity\MyArray',
        ]);
    }

    public function getBlockPrefix()
    {
        return 'my_array';
    }
}
File: Form/MyArrayType.php
File: Form/MyElementType.php
<?php

namespace Fuz\AppBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class MyElementType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('value', TextType::class, [
            'required' => false,
        ]);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => 'Fuz\AppBundle\Entity\MyElement',
        ]);
    }

    public function getBlockPrefix()
    {
        return 'my_element';
    }
}
File: Form/MyElementType.php
File: Repository/MyArrayRepository.php
<?php

namespace Fuz\AppBundle\Repository;

use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\ORM\EntityRepository;
use Fuz\AppBundle\Entity\MyArray;

/**
 * MyArrayRepository.
 */
class MyArrayRepository extends EntityRepository
{
    public function create($name)
    {
        $data = new MyArray();
        $data->setName($name);
        try {
            $this->_em->persist($data);
            $this->_em->flush();
        } catch (UniqueConstraintViolationException $e) {
            return null;
        }

        return $data;
    }

    public function save(MyArray $data)
    {
        foreach ($data->getElements() as $element) {
            $element->setArray($data);
        }
        try {
            $this->_em->persist($data);
            $this->_em->flush();
        } catch (UniqueConstraintViolationException $e) {
            return null;
        }

        return $data;
    }

    public function getArrayNames()
    {
        $arrays = $this
            ->_em
            ->createQuery("
               SELECT arr.name
               FROM Fuz\AppBundle\Entity\MyArray arr
            ")
            ->execute();
        $names = [];
        foreach ($arrays as $array) {
            $names[] = $array['name'];
        }

        return $names;
    }

    public function delete(MyArray $data)
    {
        foreach ($data->getElements() as $element) {
            $this->_em->remove($element);
        }
        $this->_em->remove($data);
        $this->_em->flush();
    }
}
File: Repository/MyArrayRepository.php
File: Resources/views/Advanced/doctrine-theme.html.twig

{% block my_element_label %}{% endblock %}
{% block my_element_errors %}{% endblock %}

{% block my_element_widget %}

    <div class="row">
        <div class="col-md-7">
            {{ form_widget(form.value) }}
        </div>
        <div class="col-md-2">
            <a href="#" class="collection-up btn btn-default">Up</a>
            <a href="#" class="collection-down btn btn-default">Down</a>
        </div>
        <div class="col-md-2">
            <a href="#" class="collection-remove btn btn-default">Remove</a>
            <a href="#" class="collection-add btn btn-default">Add</a>
        </div>
        <div class="col-md-1">
            <a href="#" class="collection-duplicate btn btn-default">Duplicate</a>
        </div>
    </div>

{% endblock %}
File: Resources/views/Advanced/doctrine-theme.html.twig
File: Resources/views/Advanced/usageWithDoctrine.html.twig
{% extends 'FuzAppBundle::layout.html.twig' %}

{% block extra_js %}
    <script src="{{ asset('js/jquery.collection.js') }}"></script>
{% endblock %}

{% block title %}Advanced usage: example with Doctrine{% endblock %}

{% block body %}

    <h2>{{ block('title') }}</h2>

    <p>
        That's not really an <i>advanced</i> topic, but the sample will be a bit hard to read (as it takes many files),
        so let's say it targets more experienced Symfony users.
    </p>

    <p>
        In this demo, we're displaying a MyArray of MyElements, both persisted into the database. The MyArray entity
        only have an id and a name, and MyElement has id, MyArray's id and a value. This is quite the same as we seen
        in all demos, but persisted.
    </p>

    <div class="text-center">
        <input type="button" id="new" class="btn btn-default" value="Create new array"/>
    </div>

    {%
        form_theme form
            'jquery.collection.html.twig'
            'FuzAppBundle:Advanced:doctrine-theme.html.twig'
    %}
    {{ form(form) }}

    <hr/>

    {% if names|length %}
        Existing arrays:
        <table class="table">
            <thead>
                <th>Name</th>
                <th>Open</th>
                <th>Delete</th>
            </thead>
            <tbody>
                {% for name in names %}
                    <tr>
                        <td>{{ name }}</td>
                        <td>
                            {% if data.name != name %}<a href="{{ path('usageWithDoctrine', {'name': name}) }}">Open</a>{% endif %}
                        </td>
                        <td><a href="{{ path('usageWithDoctrineDelete', {'name': name}) }}">Delete</a></td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% endif %}

    {{
        tabs([
            'Base/BaseController.php',
            'Controller/AdvancedController.php',
            'Resources/views/Advanced/usageWithDoctrine.html.twig',
            'Resources/views/Advanced/doctrine-theme.html.twig',
            'Entity/MyArray.php',
            'Form/MyArrayType.php',
            'Entity/MyElement.php',
            'Form/MyElementType.php',
            'Repository/MyArrayRepository.php',
        ])
    }}

{% endblock %}

{% block script %}

    <script type="text/javascript">

        // only useful for the "new" button...
        $('#new').on('click', function() {
           var name = prompt("Which name would you like to use?");
           if (name) {
               var uri = '{{ path('usageWithDoctrine', {'name': 'a'}) }}';
               document.location = uri.substr(0, uri.length - 1) + encodeURIComponent(name);
           }
        });

        $('.doctrine-sample').collection();

    </script>

{% endblock %}
File: Resources/views/Advanced/usageWithDoctrine.html.twig