This repository was archived by the owner on Feb 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +68
-1
lines changed Expand file tree Collapse file tree 6 files changed +68
-1
lines changed Original file line number Diff line number Diff line change 3
3
namespace SumoCoders \FrameworkExampleBundle \Controller ;
4
4
5
5
use Knp \Menu \MenuItem ;
6
+ use SumoCoders \FrameworkExampleBundle \Form \Type \ButtonIconType ;
6
7
use SumoCoders \FrameworkExampleBundle \Form \Type \CollectionsType ;
7
8
use SumoCoders \FrameworkExampleBundle \Form \Type \DatePickerType ;
8
9
use SumoCoders \FrameworkExampleBundle \Form \Type \LabelsType ;
@@ -33,7 +34,20 @@ public function datePickerAction()
33
34
*/
34
35
public function labelsAction ()
35
36
{
36
- $ form = $ this ->createForm (new LabelsType );
37
+ $ form = $ this ->createForm (new LabelsType ());
38
+
39
+ return array (
40
+ 'form ' => $ form ->createView (),
41
+ );
42
+ }
43
+
44
+ /**
45
+ * @Route("/tutorial/button-icons")
46
+ * @Template()
47
+ */
48
+ public function buttonIconsAction ()
49
+ {
50
+ $ form = $ this ->createForm (new ButtonIconType ());
37
51
38
52
return array (
39
53
'form ' => $ form ->createView (),
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ public function onConfigureMenu(ConfigureMenuEvent $event)
76
76
),
77
77
'example.menu.datepicker ' => 'sumocoders_frameworkexample_tutorial_datepicker ' ,
78
78
'example.menu.labels ' => 'sumocoders_frameworkexample_tutorial_labels ' ,
79
+ 'example.menu.buttonIcons ' => 'sumocoders_frameworkexample_tutorial_buttonicons ' ,
79
80
'example.menu.statistics ' => 'sumocoders_frameworkexample_tutorial_statistics ' ,
80
81
'example.menu.customBreadCrumb ' => 'sumocoders_frameworkexample_tutorial_custombreadcrumb ' ,
81
82
'example.menu.collections ' => 'sumocoders_frameworkexample_tutorial_collections ' ,
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace SumoCoders \FrameworkExampleBundle \Form \Type ;
4
+
5
+ use Symfony \Component \Form \AbstractType ;
6
+ use Symfony \Component \Form \FormBuilderInterface ;
7
+
8
+ class ButtonIconType extends AbstractType
9
+ {
10
+ /**
11
+ * {@inheritdoc}
12
+ */
13
+ public function buildForm (FormBuilderInterface $ builder , array $ options )
14
+ {
15
+ $ builder ->add (
16
+ 'example ' ,
17
+ 'submit ' ,
18
+ [
19
+ 'label ' => 'Bug ' ,
20
+ 'icon ' => 'fa fa-bug ' ,
21
+ 'attr ' => [
22
+ 'class ' => 'btn btn-large btn-default btn-block ' ,
23
+ ],
24
+ ]
25
+ );
26
+ }
27
+
28
+ /**
29
+ * {@inheritdoc}
30
+ */
31
+ public function getName ()
32
+ {
33
+ return 'buttonIcons ' ;
34
+ }
35
+ }
Original file line number Diff line number Diff line change 6
6
datepicker : datepickers
7
7
hello : hello %name%
8
8
labels : labels
9
+ buttonIcons : button icons
9
10
10
11
menu :
11
12
bootstrap : bootstrap
@@ -17,6 +18,7 @@ example:
17
18
labels : labels
18
19
tutorials : tutorials
19
20
statistics : statistics
21
+ buttonIcons : button icons
20
22
21
23
datePicker :
22
24
birthday.example : birthday
Original file line number Diff line number Diff line change 6
6
datepicker : date pickers
7
7
hello : hallo %name%
8
8
labels : labels
9
+ buttonIcons : knop iconen
9
10
10
11
menu :
11
12
bootstrap : bootstrap
@@ -15,6 +16,7 @@ example:
15
16
examples : voorbeelden
16
17
hello : hallo
17
18
labels : labels
19
+ buttonIcons : knop iconen
18
20
tutorials : howto's
19
21
statistics : statistics
20
22
Original file line number Diff line number Diff line change
1
+ {% extends ' ::base.html.twig' %}
2
+
3
+ {% block header_title %}
4
+ <h2 >
5
+ {{ ' example.header.title.buttonIcons' | trans| capitalize }}
6
+ </h2 >
7
+ {% endblock %}
8
+
9
+ {% block main %}
10
+ {{ form_start(form ) }}
11
+ {{ form_rest(form ) }}
12
+ {{ form_end(form ) }}
13
+ {% endblock %}
You can’t perform that action at this time.
0 commit comments