Commit 80bba350f0c529f9c731b710367a5af8acd03e71
1 parent
8c45a84511
Exists in
feature/edson
ultimos cambios de la practica
Showing
37 changed files
with
2518 additions
and
2 deletions
Show diff stats
app/Resources/views/base.html.twig
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
5 | 5 | |
6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
7 | - <title>SEQ-UBV | {% block title %} INICIO {% endblock %}</title> | |
7 | + <title>PRUEBA| {% block title %} INICIO {% endblock %}</title> | |
8 | 8 | <meta charset="UTF-8"> |
9 | 9 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
10 | 10 | <!-- jQuery 2.2.4 --> |
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | </div> |
133 | 133 | </div> |
134 | 134 | </div> |
135 | - </div> | |
135 | + | |
136 | 136 | <!-- /page content --> |
137 | 137 | {% endblock %} |
138 | 138 | <!-- /footer content --> | ... | ... |
app/Resources/views/candidato/edit.html.twig
... | ... | @@ -0,0 +1,21 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Candidato edit</h1> | |
5 | + | |
6 | + {{ form_start(edit_form) }} | |
7 | + {{ form_widget(edit_form) }} | |
8 | + <input type="submit" value="Edit" /> | |
9 | + {{ form_end(edit_form) }} | |
10 | + | |
11 | + <ul> | |
12 | + <li> | |
13 | + <a href="{{ path('candidato_index') }}">Back to the list</a> | |
14 | + </li> | |
15 | + <li> | |
16 | + {{ form_start(delete_form) }} | |
17 | + <input type="submit" value="Delete"> | |
18 | + {{ form_end(delete_form) }} | |
19 | + </li> | |
20 | + </ul> | |
21 | +{% endblock %} | ... | ... |
app/Resources/views/candidato/index.html.twig
... | ... | @@ -0,0 +1,72 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + | |
5 | +{% for type, flashMessage in app.session.flashbag.all() %} | |
6 | +<div class="alert alert-{{ type }} fade in"> | |
7 | +<button class="close" data-dismiss="alert" type="button">×</button> | |
8 | +{% if flashMessage.title is defined %} | |
9 | +<strong>{{ flashMessage.title }}</strong> | |
10 | +{{ flashMessage.message }} | |
11 | +{% else %} | |
12 | +{{ type }} | |
13 | +{% endif %} | |
14 | +</div> | |
15 | +{% endfor %} | |
16 | + | |
17 | + <h1>Lista de Candidatos</h1> | |
18 | + | |
19 | + <a class="btn btn-default" role="button" href="{{ path('candidato_new') }}"> <span class="glyphicon glyphicon-plus"> Agregar </span> </a> | |
20 | + | |
21 | + <table class="table table-hover"> | |
22 | + <thead> | |
23 | + <tr> | |
24 | + <th>Cedula</th> | |
25 | + <th>Nombre</th> | |
26 | + <th>Apellido</th> | |
27 | + <th>Status</th> | |
28 | + <th>Instruccion</th> | |
29 | + <th>Ocupacion</th> | |
30 | + <th>Promedio</th> | |
31 | + <th>Institucion</th> | |
32 | + <th>Pais</th> | |
33 | + <th>Estado</th> | |
34 | + <th>Municipio</th> | |
35 | + <th>Direccion</th> | |
36 | + <th>Actions</th> | |
37 | + </tr> | |
38 | + </thead> | |
39 | + <tbody> | |
40 | + {% for candidato in candidatos %} | |
41 | + <tr> | |
42 | + <td><a href="{{ path('candidato_show', { 'id': candidato.id }) }}">{{ candidato.cedula }}</a></td> | |
43 | + <td>{{ candidato.nombre }}</td> | |
44 | + <td>{{ candidato.apellido }}</td> | |
45 | + <td>{% if candidato.activo %}Yes{% else %}No{% endif %}</td> | |
46 | + <td>{{ candidato.instruccion }}</td> | |
47 | + <td>{{ candidato.ocupacion }}</td> | |
48 | + <td>{{ candidato.promedio }}</td> | |
49 | + <td>{{ candidato.institucion }}</td> | |
50 | + <td>{{ candidato.pais }}</td> | |
51 | + <td>{{ candidato.estado }}</td> | |
52 | + <td>{{ candidato.municipio }}</td> | |
53 | + <td>{{ candidato.direccion }}</td> | |
54 | + <td> | |
55 | + | |
56 | + | |
57 | + <ul> | |
58 | + | |
59 | + <a class="btn btn-default" role="button" href="{{ path('candidato_show', { 'id': candidato.id }) }}"> <span class="glyphicon glyphicon-eye-open"></span></a> | |
60 | + | |
61 | + | |
62 | + <a class="btn btn-default" role="button" href="{{ path('candidato_edit', { 'id': candidato.id }) }}"> <span class="glyphicon glyphicon-pencil"></span></a> | |
63 | + | |
64 | + </ul> | |
65 | + </td> | |
66 | + </tr> | |
67 | + {% endfor %} | |
68 | + </tbody> | |
69 | + </table> | |
70 | + | |
71 | + | |
72 | +{% endblock %} | ... | ... |
app/Resources/views/candidato/new.html.twig
... | ... | @@ -0,0 +1,157 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Creacion de Candidato</h1> | |
5 | + <br> | |
6 | + <h3> Datos Personales </h3> | |
7 | + <div class="row"> | |
8 | + <div class="col-xs-4"> | |
9 | + {{ form_label(form.nombre) }} | |
10 | + {{ form_widget(form.nombre) }} | |
11 | + {% if form.cedula.vars.errors[0].message is defined %} | |
12 | + <span class="help-block"> | |
13 | + {{ form.nombre.vars.errors[0].message }} | |
14 | + </span> | |
15 | + {% endif %} | |
16 | + </div> | |
17 | + <div class="col-xs-4"> | |
18 | + {{ form_label(form.apellido) }} | |
19 | + {{ form_widget(form.apellido) }} | |
20 | + {% if form.apellido.vars.errors[0].message is defined %} | |
21 | + <span class="help-block"> | |
22 | + {{ form.apellido.vars.errors[0].message }} | |
23 | + </span> | |
24 | + {% endif %} | |
25 | + </div> | |
26 | + </div> | |
27 | + <br> | |
28 | + <div class="row"> | |
29 | + <div class="col-xs-4"> | |
30 | + {{ form_label(form.cedula) }} | |
31 | + {{ form_widget(form.cedula) }} | |
32 | + {% if form.cedula.vars.errors[0].message is defined %} | |
33 | + <span class="help-block"> | |
34 | + {{ form.cedula.vars.errors[0].message }} | |
35 | + </span> | |
36 | + {% endif %} | |
37 | + </div> | |
38 | + </div> | |
39 | + <div class="row"> | |
40 | + <div class="col-xs-4"> | |
41 | + {{ form_label(form.activo) }} | |
42 | + {{ form_widget(form.activo) }} | |
43 | + {% if form.edad.vars.errors[0].message is defined %} | |
44 | + <span class="help-block"> | |
45 | + {{ form.activo.vars.errors[0].message }} | |
46 | + </span> | |
47 | + {% endif %} | |
48 | + </div> | |
49 | + </div> | |
50 | + <br> | |
51 | + <h3> Datos Academicos </h3> | |
52 | + <div class="row"> | |
53 | + <div class="col-xs-4"> | |
54 | + | |
55 | + {{ form_label(form.instruccion) }} | |
56 | + {{ form_widget(form.instruccion) }} | |
57 | + {% if form.instruccion.vars.errors[0].message is defined %} | |
58 | + <span class="help-block"> | |
59 | + {{ form.instruccion.vars.errors[0].message }} | |
60 | + </span> | |
61 | + {% endif %} | |
62 | + </div> | |
63 | + <div class="col-xs-4"> | |
64 | + | |
65 | + {{ form_label(form.ocupacion) }} | |
66 | + {{ form_widget(form.ocupacion) }} | |
67 | + {% if form.ocupacion.vars.errors[0].message is defined %} | |
68 | + <span class="help-block"> | |
69 | + {{ form.ocupacion.vars.errors[0].message }} | |
70 | + </span> | |
71 | + {% endif %} | |
72 | + </div> | |
73 | + </div> | |
74 | + <br> | |
75 | + <div class="row"> | |
76 | + <div class="col-xs-4"> | |
77 | + | |
78 | + {{ form_label(form.promedio) }} | |
79 | + {{ form_widget(form.promedio) }} | |
80 | + {% if form.promedio.vars.errors[0].message is defined %} | |
81 | + <span class="help-block"> | |
82 | + {{ form.promedio.vars.errors[0].message }} | |
83 | + </span> | |
84 | + {% endif %} | |
85 | + </div> | |
86 | + <div class="col-xs-4"> | |
87 | + | |
88 | + {{ form_label(form.institucion) }} | |
89 | + {{ form_widget(form.institucion) }} | |
90 | + {% if form.instruccion.vars.errors[0].message is defined %} | |
91 | + <span class="help-block"> | |
92 | + {{ form.instruccion.vars.errors[0].message }} | |
93 | + </span> | |
94 | + {% endif %} | |
95 | + </div> | |
96 | + </div> | |
97 | + <br> | |
98 | + <br> | |
99 | + <h3> Ubicacion Geografica </h3> | |
100 | + <div class="row"> | |
101 | + <div class="col-xs-4"> | |
102 | + {{ form_label(form.pais) }} | |
103 | + {{ form_widget(form.pais) }} | |
104 | + {% if form.pais.vars.errors[0].message is defined %} | |
105 | + <span class="help-block"> | |
106 | + {{ form.pais.vars.errors[0].message }} | |
107 | + </span> | |
108 | + {% endif %} | |
109 | + </div> | |
110 | + <div class="col-xs-4"> | |
111 | + <div class="form-group"> | |
112 | + <label for="sel1">Seleccione un estado:</label> | |
113 | + <select class="form-control" id="sel1"> | |
114 | + <option>Seleccione...</option> | |
115 | + <option>Distrito Capital</option> | |
116 | + <option>Miranda</option> | |
117 | + <option>Tachira</option> | |
118 | + <option>Aragua</option> | |
119 | + </select> | |
120 | + {% if form.estado.vars.errors[0].message is defined %} | |
121 | + <span class="help-block"> | |
122 | + {{ form.estado.vars.errors[0].message }} | |
123 | + </span> | |
124 | + {% endif %} | |
125 | + </div> | |
126 | + </div> | |
127 | + </div> | |
128 | + <div class="row"> | |
129 | + <div class="col-xs-4"> | |
130 | + {{ form_label(form.municipio) }} | |
131 | + {{ form_widget(form.municipio) }} | |
132 | + {% if form.municipio.vars.errors[0].message is defined %} | |
133 | + <span class="help-block"> | |
134 | + {{ form.municipio.vars.errors[0].message }} | |
135 | + </span> | |
136 | + {% endif %} | |
137 | + </div> | |
138 | + <div class="col-xs-4"> | |
139 | + {{ form_label(form.direccion) }} | |
140 | + {{ form_widget(form.direccion) }} | |
141 | + {% if form.direccion.vars.errors[0].message is defined %} | |
142 | + <span class="help-block"> | |
143 | + {{ form.direccion.vars.errors[0].message }} | |
144 | + </span> | |
145 | + {% endif %} | |
146 | + </div> | |
147 | + </div> | |
148 | + | |
149 | + <input type="submit" value="Create" /> | |
150 | + | |
151 | + | |
152 | + <ul> | |
153 | + | |
154 | + <a href="{{ path('candidato_index') }}">Back to the list</a> | |
155 | + | |
156 | + </ul> | |
157 | +{% endblock %} | ... | ... |
app/Resources/views/candidato/show.html.twig
... | ... | @@ -0,0 +1,76 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Candidato</h1> | |
5 | + | |
6 | + <table> | |
7 | + <tbody> | |
8 | + <tr> | |
9 | + <th>Id</th> | |
10 | + <td>{{ candidato.id }}</td> | |
11 | + </tr> | |
12 | + <tr> | |
13 | + <th>Nombre</th> | |
14 | + <td>{{ candidato.nombre }}</td> | |
15 | + </tr> | |
16 | + <tr> | |
17 | + <th>Apellido</th> | |
18 | + <td>{{ candidato.apellido }}</td> | |
19 | + </tr> | |
20 | + <tr> | |
21 | + <th>Cedula</th> | |
22 | + <td>{{ candidato.cedula }}</td> | |
23 | + </tr> | |
24 | + <tr> | |
25 | + <th>Activo</th> | |
26 | + <td>{% if candidato.activo %}Yes{% else %}No{% endif %}</td> | |
27 | + </tr> | |
28 | + <tr> | |
29 | + <th>Instruccion</th> | |
30 | + <td>{{ candidato.instruccion }}</td> | |
31 | + </tr> | |
32 | + <tr> | |
33 | + <th>Ocupacion</th> | |
34 | + <td>{{ candidato.ocupacion }}</td> | |
35 | + </tr> | |
36 | + <tr> | |
37 | + <th>Promedio</th> | |
38 | + <td>{{ candidato.promedio }}</td> | |
39 | + </tr> | |
40 | + <tr> | |
41 | + <th>Institucion</th> | |
42 | + <td>{{ candidato.institucion }}</td> | |
43 | + </tr> | |
44 | + <tr> | |
45 | + <th>Pais</th> | |
46 | + <td>{{ candidato.pais }}</td> | |
47 | + </tr> | |
48 | + <tr> | |
49 | + <th>Estado</th> | |
50 | + <td>{{ candidato.estado }}</td> | |
51 | + </tr> | |
52 | + <tr> | |
53 | + <th>Municipio</th> | |
54 | + <td>{{ candidato.municipio }}</td> | |
55 | + </tr> | |
56 | + <tr> | |
57 | + <th>Direccion</th> | |
58 | + <td>{{ candidato.direccion }}</td> | |
59 | + </tr> | |
60 | + </tbody> | |
61 | + </table> | |
62 | + | |
63 | + <ul> | |
64 | + <li> | |
65 | + <a href="{{ path('candidato_index') }}">Back to the list</a> | |
66 | + </li> | |
67 | + <li> | |
68 | + <a href="{{ path('candidato_edit', { 'id': candidato.id }) }}">Edit</a> | |
69 | + </li> | |
70 | + <li> | |
71 | + {{ form_start(delete_form) }} | |
72 | + <input type="submit" value="Delete"> | |
73 | + {{ form_end(delete_form) }} | |
74 | + </li> | |
75 | + </ul> | |
76 | +{% endblock %} | ... | ... |
app/Resources/views/estado/edit.html.twig
... | ... | @@ -0,0 +1,21 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Estado edit</h1> | |
5 | + | |
6 | + {{ form_start(edit_form) }} | |
7 | + {{ form_widget(edit_form) }} | |
8 | + <input type="submit" value="Edit" /> | |
9 | + {{ form_end(edit_form) }} | |
10 | + | |
11 | + <ul> | |
12 | + <li> | |
13 | + <a href="{{ path('estado_index') }}">Back to the list</a> | |
14 | + </li> | |
15 | + <li> | |
16 | + {{ form_start(delete_form) }} | |
17 | + <input type="submit" value="Delete"> | |
18 | + {{ form_end(delete_form) }} | |
19 | + </li> | |
20 | + </ul> | |
21 | +{% endblock %} | ... | ... |
app/Resources/views/estado/index.html.twig
... | ... | @@ -0,0 +1,41 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Estados list</h1> | |
5 | + | |
6 | + <table> | |
7 | + <thead> | |
8 | + <tr> | |
9 | + <th>Id</th> | |
10 | + <th>Descripcion</th> | |
11 | + <th>Codigo</th> | |
12 | + <th>Actions</th> | |
13 | + </tr> | |
14 | + </thead> | |
15 | + <tbody> | |
16 | + {% for estado in estados %} | |
17 | + <tr> | |
18 | + <td><a href="{{ path('estado_show', { 'id': estado.id }) }}">{{ estado.id }}</a></td> | |
19 | + <td>{{ estado.descripcion }}</td> | |
20 | + <td>{{ estado.codigo }}</td> | |
21 | + <td> | |
22 | + <ul> | |
23 | + <li> | |
24 | + <a href="{{ path('estado_show', { 'id': estado.id }) }}">show</a> | |
25 | + </li> | |
26 | + <li> | |
27 | + <a href="{{ path('estado_edit', { 'id': estado.id }) }}">edit</a> | |
28 | + </li> | |
29 | + </ul> | |
30 | + </td> | |
31 | + </tr> | |
32 | + {% endfor %} | |
33 | + </tbody> | |
34 | + </table> | |
35 | + | |
36 | + <ul> | |
37 | + <li> | |
38 | + <a href="{{ path('estado_new') }}">Create a new estado</a> | |
39 | + </li> | |
40 | + </ul> | |
41 | +{% endblock %} | ... | ... |
app/Resources/views/estado/new.html.twig
... | ... | @@ -0,0 +1,16 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Estado creation</h1> | |
5 | + | |
6 | + {{ form_start(form) }} | |
7 | + {{ form_widget(form) }} | |
8 | + <input type="submit" value="Create" /> | |
9 | + {{ form_end(form) }} | |
10 | + | |
11 | + <ul> | |
12 | + <li> | |
13 | + <a href="{{ path('estado_index') }}">Back to the list</a> | |
14 | + </li> | |
15 | + </ul> | |
16 | +{% endblock %} | ... | ... |
app/Resources/views/estado/show.html.twig
... | ... | @@ -0,0 +1,36 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Estado</h1> | |
5 | + | |
6 | + <table> | |
7 | + <tbody> | |
8 | + <tr> | |
9 | + <th>Id</th> | |
10 | + <td>{{ estado.id }}</td> | |
11 | + </tr> | |
12 | + <tr> | |
13 | + <th>Descripcion</th> | |
14 | + <td>{{ estado.descripcion }}</td> | |
15 | + </tr> | |
16 | + <tr> | |
17 | + <th>Codigo</th> | |
18 | + <td>{{ estado.codigo }}</td> | |
19 | + </tr> | |
20 | + </tbody> | |
21 | + </table> | |
22 | + | |
23 | + <ul> | |
24 | + <li> | |
25 | + <a href="{{ path('estado_index') }}">Back to the list</a> | |
26 | + </li> | |
27 | + <li> | |
28 | + <a href="{{ path('estado_edit', { 'id': estado.id }) }}">Edit</a> | |
29 | + </li> | |
30 | + <li> | |
31 | + {{ form_start(delete_form) }} | |
32 | + <input type="submit" value="Delete"> | |
33 | + {{ form_end(delete_form) }} | |
34 | + </li> | |
35 | + </ul> | |
36 | +{% endblock %} | ... | ... |
app/Resources/views/municipio/edit.html.twig
... | ... | @@ -0,0 +1,21 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Municipio edit</h1> | |
5 | + | |
6 | + {{ form_start(edit_form) }} | |
7 | + {{ form_widget(edit_form) }} | |
8 | + <input type="submit" value="Edit" /> | |
9 | + {{ form_end(edit_form) }} | |
10 | + | |
11 | + <ul> | |
12 | + <li> | |
13 | + <a href="{{ path('municipio_index') }}">Back to the list</a> | |
14 | + </li> | |
15 | + <li> | |
16 | + {{ form_start(delete_form) }} | |
17 | + <input type="submit" value="Delete"> | |
18 | + {{ form_end(delete_form) }} | |
19 | + </li> | |
20 | + </ul> | |
21 | +{% endblock %} | ... | ... |
app/Resources/views/municipio/index.html.twig
... | ... | @@ -0,0 +1,43 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Municipios list</h1> | |
5 | + | |
6 | + <table class="table table-hover"> | |
7 | + <thead> | |
8 | + <tr> | |
9 | + <th>Id</th> | |
10 | + <th>Descripcion</th> | |
11 | + <th>Codigo</th> | |
12 | + <th>Estado</th> | |
13 | + <th>Actions</th> | |
14 | + </tr> | |
15 | + </thead> | |
16 | + <tbody> | |
17 | + {% for municipio in municipios %} | |
18 | + <tr> | |
19 | + <td><a href="{{ path('municipio_show', { 'id': municipio.id }) }}">{{ municipio.id }}</a></td> | |
20 | + <td>{{ municipio.descripcion }}</td> | |
21 | + <td>{{ municipio.codigo }}</td> | |
22 | + <td>{{ municipio.estado }}</td> | |
23 | + <td> | |
24 | + <ul> | |
25 | + <li> | |
26 | + <a href="{{ path('municipio_show', { 'id': municipio.id }) }}">show</a> | |
27 | + </li> | |
28 | + <li> | |
29 | + <a href="{{ path('municipio_edit', { 'id': municipio.id }) }}">edit</a> | |
30 | + </li> | |
31 | + </ul> | |
32 | + </td> | |
33 | + </tr> | |
34 | + {% endfor %} | |
35 | + </tbody> | |
36 | + </table> | |
37 | + | |
38 | + <ul> | |
39 | + <li> | |
40 | + <a href="{{ path('municipio_new') }}">Create a new municipio</a> | |
41 | + </li> | |
42 | + </ul> | |
43 | +{% endblock %} | ... | ... |
app/Resources/views/municipio/new.html.twig
... | ... | @@ -0,0 +1,16 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Municipio creation</h1> | |
5 | + | |
6 | + {{ form_start(form) }} | |
7 | + {{ form_widget(form) }} | |
8 | + <input type="submit" value="Create" /> | |
9 | + {{ form_end(form) }} | |
10 | + | |
11 | + <ul> | |
12 | + <li> | |
13 | + <a href="{{ path('municipio_index') }}">Back to the list</a> | |
14 | + </li> | |
15 | + </ul> | |
16 | +{% endblock %} | ... | ... |
app/Resources/views/municipio/show.html.twig
... | ... | @@ -0,0 +1,36 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Municipio</h1> | |
5 | + | |
6 | + <table> | |
7 | + <tbody> | |
8 | + <tr> | |
9 | + <th>Id</th> | |
10 | + <td>{{ municipio.id }}</td> | |
11 | + </tr> | |
12 | + <tr> | |
13 | + <th>Descripcion</th> | |
14 | + <td>{{ municipio.descripcion }}</td> | |
15 | + </tr> | |
16 | + <tr> | |
17 | + <th>Codigo</th> | |
18 | + <td>{{ municipio.codigo }}</td> | |
19 | + </tr> | |
20 | + </tbody> | |
21 | + </table> | |
22 | + | |
23 | + <ul> | |
24 | + <li> | |
25 | + <a href="{{ path('municipio_index') }}">Back to the list</a> | |
26 | + </li> | |
27 | + <li> | |
28 | + <a href="{{ path('municipio_edit', { 'id': municipio.id }) }}">Edit</a> | |
29 | + </li> | |
30 | + <li> | |
31 | + {{ form_start(delete_form) }} | |
32 | + <input type="submit" value="Delete"> | |
33 | + {{ form_end(delete_form) }} | |
34 | + </li> | |
35 | + </ul> | |
36 | +{% endblock %} | ... | ... |
app/Resources/views/pruebaed/edit.html.twig
... | ... | @@ -0,0 +1,89 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Editar Prueba</h1> | |
5 | + | |
6 | + | |
7 | + <form action="{{ path('pruebaed_edit', { 'id': pruebaed.id }) }}" id="form_pruebaed" novalidate method="POST" {{ form_enctype(edit_form)}}> | |
8 | + | |
9 | + | |
10 | + <div class="row"> | |
11 | + <div class="col-xs-4"> | |
12 | + <div class="form-group{% if edit_form.nombre.vars.errors[0].message is defined %} has-error{% endif %}"> | |
13 | + {{ form_label(edit_form.nombre) }} | |
14 | + {{ form_widget(edit_form.nombre) }} | |
15 | + | |
16 | + {% if form.nombre.vars.errors[0].message is defined %} | |
17 | + <span class="help-block"> | |
18 | + {{ form.nombre.vars.errors[0].message }} | |
19 | + </span> | |
20 | + {% endif %} | |
21 | + </div> | |
22 | + </div> | |
23 | + <div class="col-xs-4"> | |
24 | + <div class="form-group{% if edit_form.apellido.vars.errors[0].message is defined %} has-error{% endif %}"> | |
25 | + {{ form_label(edit_form.apellido) }} | |
26 | + {{ form_widget(edit_form.apellido) }} | |
27 | + {% if form.apellido.vars.errors[0].message is defined %} | |
28 | + <span class="help-block"> | |
29 | + {{ form.apellido.vars.errors[0].message }} | |
30 | + </span> | |
31 | + {% endif %} | |
32 | + </div> | |
33 | + </div> | |
34 | + </div> | |
35 | + <br> | |
36 | + <div class="row"> | |
37 | + <div class="col-xs-4"> | |
38 | + <div class="form-group{% if edit_form.cedula.vars.errors[0].message is defined %} has-error{% endif %}"> | |
39 | + {{ form_label(edit_form.cedula) }} | |
40 | + {{ form_widget(edit_form.cedula) }} | |
41 | + {% if form.cedula.vars.errors[0].message is defined %} | |
42 | + <span class="help-block"> | |
43 | + {{ form.cedula.vars.errors[0].message }} | |
44 | + </span> | |
45 | + {% endif %} | |
46 | + </div> | |
47 | + </div> | |
48 | + <div class="col-xs-4"> | |
49 | + <div class="form-group{% if edit_form.cedula.vars.errors[0].message is defined %} has-error{% endif %}"> | |
50 | + {{ form_label(edit_form.edad) }} | |
51 | + {{ form_widget(edit_form.edad) }} | |
52 | + {% if form.edad.vars.errors[0].message is defined %} | |
53 | + <span class="help-block"> | |
54 | + {{ form.edad.vars.errors[0].message }} | |
55 | + </span> | |
56 | + {% endif %} | |
57 | + </div> | |
58 | + </div> | |
59 | + </div> | |
60 | + <br> | |
61 | + <div class="row"> | |
62 | + <div class="col-xs-4"> | |
63 | + <div class="form-group{% if edit_form.cedula.vars.errors[0].message is defined %} has-error{% endif %}"> | |
64 | + {{ form_label(edit_form.direccion) }} | |
65 | + {{ form_widget(edit_form.direccion) }} | |
66 | + {% if form.direccion.vars.errors[0].message is defined %} | |
67 | + <span class="help-block"> | |
68 | + {{ form.direccion.vars.errors[0].message }} | |
69 | + </span> | |
70 | + {% endif %} | |
71 | + </div> | |
72 | + </div> | |
73 | + </div> | |
74 | + <br> | |
75 | + | |
76 | + <div style="text-align:center"> | |
77 | + <div> | |
78 | + <ul> | |
79 | + | |
80 | + <input type="submit" class="btn btn-default" role="button" value="Save" /> | |
81 | + {{form_widget(edit_form._token)}} | |
82 | + | |
83 | + <a class="btn btn-default" role="button" href="{{ path('pruebaed_index') }}"><span class="glyphicon glyphicon-arrow-left"></span></a> | |
84 | + </ul> | |
85 | + </div> | |
86 | + </div> | |
87 | + | |
88 | + | |
89 | +{% endblock %} | ... | ... |
app/Resources/views/pruebaed/index.html.twig
... | ... | @@ -0,0 +1,59 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + | |
5 | +{% for type, flashMessage in app.session.flashbag.all() %} | |
6 | +<div class="alert alert-{{ type }} fade in"> | |
7 | +<button class="close" data-dismiss="alert" type="button">×</button> | |
8 | +{% if flashMessage.title is defined %} | |
9 | +<strong>{{ flashMessage.title }}</strong> | |
10 | +{{ flashMessage.message }} | |
11 | +{% else %} | |
12 | +{{ type }} | |
13 | +{% endif %} | |
14 | +</div> | |
15 | +{% endfor %} | |
16 | + | |
17 | + <h1>Lista de Pruebaeds</h1> | |
18 | + | |
19 | + <a class="btn btn-default" role="button" href="{{ path('pruebaed_new') }}"> <span class="glyphicon glyphicon-plus"> Agregar </span> </a> | |
20 | + | |
21 | + <table class="table table-hover"> | |
22 | + <thead> | |
23 | + <tr> | |
24 | + <th>Id</th> | |
25 | + <th>Nombre</th> | |
26 | + <th>Apellido</th> | |
27 | + <th>Cedula</th> | |
28 | + <th>Edad</th> | |
29 | + <th>Direccion</th> | |
30 | + <th>Actions</th> | |
31 | + </tr> | |
32 | + </thead> | |
33 | + <tbody> | |
34 | + {% for pruebaed in pruebaeds %} | |
35 | + <tr> | |
36 | + <td><a href="{{ path('pruebaed_show', { 'id': pruebaed.id }) }}">{{ pruebaed.id }}</a></td> | |
37 | + <td>{{ pruebaed.nombre }}</td> | |
38 | + <td>{{ pruebaed.apellido }}</td> | |
39 | + <td><a href="{{ path('pruebaed_show', { 'id': pruebaed.id }) }}">{{ pruebaed.cedula }}</td> | |
40 | + <td>{{ pruebaed.edad }}</td> | |
41 | + <td>{{ pruebaed.direccion }}</td> | |
42 | + <td> | |
43 | + <ul> | |
44 | + | |
45 | + <a class="btn btn-default" role="button" href="{{ path('pruebaed_show', { 'id': pruebaed.id }) }}"><span class="glyphicon glyphicon-eye-open"></span></a> | |
46 | + | |
47 | + <a class="btn btn-default" role="button" href="{{ path('pruebaed_edit', { 'id': pruebaed.id }) }}"><span class="glyphicon glyphicon-pencil"></span></a> | |
48 | + | |
49 | + </ul> | |
50 | + </td> | |
51 | + </tr> | |
52 | + {% endfor %} | |
53 | + </tbody> | |
54 | + </table> | |
55 | + | |
56 | + <ul> | |
57 | + | |
58 | + </ul> | |
59 | +{% endblock %} | ... | ... |
app/Resources/views/pruebaed/new.html.twig
... | ... | @@ -0,0 +1,80 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Registro Prueba</h1> | |
5 | + | |
6 | + {{ form_start(form, {'attr': {'novalidate': 'novalidate'}, 'action': path('pruebaed_new')}) }} | |
7 | + | |
8 | + | |
9 | + | |
10 | + <div class="row"> | |
11 | + <div class="col-xs-4"> | |
12 | + {{ form_label(form.nombre) }} | |
13 | + {{ form_widget(form.nombre) }} | |
14 | + {% if form.cedula.vars.errors[0].message is defined %} | |
15 | + <span class="help-block"> | |
16 | + {{ form.nombre.vars.errors[0].message }} | |
17 | + </span> | |
18 | + {% endif %} | |
19 | + </div> | |
20 | + <div class="col-xs-4"> | |
21 | + {{ form_label(form.apellido) }} | |
22 | + {{ form_widget(form.apellido) }} | |
23 | + {% if form.apellido.vars.errors[0].message is defined %} | |
24 | + <span class="help-block"> | |
25 | + {{ form.apellido.vars.errors[0].message }} | |
26 | + </span> | |
27 | + {% endif %} | |
28 | + </div> | |
29 | + </div> | |
30 | + <br> | |
31 | + <div class="row"> | |
32 | + <div class="col-xs-4"> | |
33 | + {{ form_label(form.cedula) }} | |
34 | + {{ form_widget(form.cedula) }} | |
35 | + {% if form.cedula.vars.errors[0].message is defined %} | |
36 | + <span class="help-block"> | |
37 | + {{ form.cedula.vars.errors[0].message }} | |
38 | + </span> | |
39 | + {% endif %} | |
40 | + </div> | |
41 | + <div class="col-xs-4"> | |
42 | + | |
43 | + {{ form_label(form.edad) }} | |
44 | + {{ form_widget(form.edad) }} | |
45 | + {% if form.edad.vars.errors[0].message is defined %} | |
46 | + <span class="help-block"> | |
47 | + {{ form.edad.vars.errors[0].message }} | |
48 | + </span> | |
49 | + {% endif %} | |
50 | + </div> | |
51 | + </div> | |
52 | + <br> | |
53 | + <div class="row"> | |
54 | + <div class="col-xs-4"> | |
55 | + {{ form_label(form.direccion) }} | |
56 | + {{ form_widget(form.direccion) }} | |
57 | + {% if form.direccion.vars.errors[0].message is defined %} | |
58 | + <span class="help-block"> | |
59 | + {{ form.direccion.vars.errors[0].message }} | |
60 | + </span> | |
61 | + {% endif %} | |
62 | + </div> | |
63 | + </div> | |
64 | + <br> | |
65 | + <div style="text-align:right"> | |
66 | + <div> | |
67 | + <ul> | |
68 | + <input type="submit" class="btn btn-default" role="button" value="Crear" /> | |
69 | + {{form_end(form)}} | |
70 | + | |
71 | + <a class="btn btn-warning" role="button" href="{{ path('pruebaed_index') }}"> <span class="glyphicon glyphicon-arrow-left"></span> </a> | |
72 | + </ul> | |
73 | + </div> | |
74 | + </div> | |
75 | + | |
76 | + | |
77 | + | |
78 | + | |
79 | + | |
80 | +{% endblock %} | ... | ... |
app/Resources/views/pruebaed/show.html.twig
... | ... | @@ -0,0 +1,46 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | +{% block body %} | |
4 | + <h1>Pruebaed</h1> | |
5 | + | |
6 | + | |
7 | + <table class="table table-hover"> | |
8 | + <tbody> | |
9 | + <tr> | |
10 | + <th>Id</th> | |
11 | + <td>{{ pruebaed.id }}</td> | |
12 | + </tr> | |
13 | + <tr> | |
14 | + <th>Nombre</th> | |
15 | + <td>{{ pruebaed.nombre }}</td> | |
16 | + </tr> | |
17 | + <tr> | |
18 | + <th>Apellido</th> | |
19 | + <td>{{ pruebaed.apellido }}</td> | |
20 | + </tr> | |
21 | + <tr> | |
22 | + <th>Cedula</th> | |
23 | + <td>{{ pruebaed.cedula }}</td> | |
24 | + </tr> | |
25 | + <tr> | |
26 | + <th>Edad</th> | |
27 | + <td>{{ pruebaed.edad }}</td> | |
28 | + </tr> | |
29 | + <tr> | |
30 | + <th>Direccion</th> | |
31 | + <td>{{ pruebaed.direccion }}</td> | |
32 | + </tr> | |
33 | + </tbody> | |
34 | + </table> | |
35 | + | |
36 | + <ul> | |
37 | + | |
38 | + <a class="btn btn-default" role="button" href="{{ path('pruebaed_index') }}"> <span class="glyphicon glyphicon-arrow-left"></span></a> | |
39 | + <a class="btn btn-default" role="button" href="{{ path('pruebaed_edit', { 'id': pruebaed.id }) }}"><span class="glyphicon glyphicon-pencil"></span></a> | |
40 | + | |
41 | + {{ form_start(delete_form) }} | |
42 | + <input type="submit" value="Delete"> | |
43 | + {{ form_end(delete_form) }} | |
44 | + | |
45 | + </ul> | |
46 | +{% endblock %} | ... | ... |
src/UBV/PracticaBundle/Controller/candidatoController.php
... | ... | @@ -0,0 +1,139 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Controller; | |
4 | + | |
5 | +use UBV\PracticaBundle\Entity\candidato; | |
6 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
7 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
8 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
9 | +use Symfony\Component\HttpFoundation\Request; | |
10 | + | |
11 | +/** | |
12 | + * Candidato controller. | |
13 | + * | |
14 | + * @Route("candidato") | |
15 | + */ | |
16 | +class candidatoController extends Controller | |
17 | +{ | |
18 | + /** | |
19 | + * Lists all candidato entities. | |
20 | + * | |
21 | + * @Route("/", name="candidato_index") | |
22 | + * @Method("GET") | |
23 | + */ | |
24 | + public function indexAction() | |
25 | + { | |
26 | + $em = $this->getDoctrine()->getManager(); | |
27 | + | |
28 | + $candidatos = $em->getRepository('UBVPracticaBundle:candidato')->findAll(); | |
29 | + | |
30 | + return $this->render('candidato/index.html.twig', array( | |
31 | + 'candidatos' => $candidatos, | |
32 | + )); | |
33 | + } | |
34 | + | |
35 | + /** | |
36 | + * Creates a new candidato entity. | |
37 | + * | |
38 | + * @Route("/new", name="candidato_new") | |
39 | + * @Method({"GET", "POST"}) | |
40 | + */ | |
41 | + public function newAction(Request $request) | |
42 | + { | |
43 | + $candidato = new Candidato(); | |
44 | + $form = $this->createForm('UBV\PracticaBundle\Form\candidatoType', $candidato); | |
45 | + $form->handleRequest($request); | |
46 | + | |
47 | + if ($form->isSubmitted() && $form->isValid()) { | |
48 | + $em = $this->getDoctrine()->getManager(); | |
49 | + $em->persist($candidato); | |
50 | + $em->flush(); | |
51 | + | |
52 | + return $this->redirectToRoute('candidato_index', array('id' => $candidato->getId())); | |
53 | + } | |
54 | + | |
55 | + return $this->render('candidato/new.html.twig', array( | |
56 | + 'candidato' => $candidato, | |
57 | + 'form' => $form->createView(), | |
58 | + )); | |
59 | + } | |
60 | + | |
61 | + /** | |
62 | + * Finds and displays a candidato entity. | |
63 | + * | |
64 | + * @Route("/{id}", name="candidato_show") | |
65 | + * @Method("GET") | |
66 | + */ | |
67 | + public function showAction(candidato $candidato) | |
68 | + { | |
69 | + $deleteForm = $this->createDeleteForm($candidato); | |
70 | + | |
71 | + return $this->render('candidato/show.html.twig', array( | |
72 | + 'candidato' => $candidato, | |
73 | + 'delete_form' => $deleteForm->createView(), | |
74 | + )); | |
75 | + } | |
76 | + | |
77 | + /** | |
78 | + * Displays a form to edit an existing candidato entity. | |
79 | + * | |
80 | + * @Route("/{id}/edit", name="candidato_edit") | |
81 | + * @Method({"GET", "POST"}) | |
82 | + */ | |
83 | + public function editAction(Request $request, candidato $candidato) | |
84 | + { | |
85 | + $deleteForm = $this->createDeleteForm($candidato); | |
86 | + $editForm = $this->createForm('UBV\PracticaBundle\Form\candidatoType', $candidato); | |
87 | + $editForm->handleRequest($request); | |
88 | + | |
89 | + if ($editForm->isSubmitted() && $editForm->isValid()) { | |
90 | + $this->getDoctrine()->getManager()->flush(); | |
91 | + | |
92 | + $this->get('session')->getFlashBag()->set( 'success', array( 'title' => 'Editado Satisfactoriamente!', 'message' => 'Estado creado satisfactoriamente.' ) ); | |
93 | + | |
94 | + return $this->redirectToRoute('candidato_edit', array('id' => $candidato->getId())); | |
95 | + } | |
96 | + | |
97 | + return $this->render('candidato/edit.html.twig', array( | |
98 | + 'candidato' => $candidato, | |
99 | + 'edit_form' => $editForm->createView(), | |
100 | + 'delete_form' => $deleteForm->createView(), | |
101 | + )); | |
102 | + } | |
103 | + | |
104 | + /** | |
105 | + * Deletes a candidato entity. | |
106 | + * | |
107 | + * @Route("/{id}", name="candidato_delete") | |
108 | + * @Method("DELETE") | |
109 | + */ | |
110 | + public function deleteAction(Request $request, candidato $candidato) | |
111 | + { | |
112 | + $form = $this->createDeleteForm($candidato); | |
113 | + $form->handleRequest($request); | |
114 | + | |
115 | + if ($form->isSubmitted() && $form->isValid()) { | |
116 | + $em = $this->getDoctrine()->getManager(); | |
117 | + $em->remove($candidato); | |
118 | + $em->flush(); | |
119 | + } | |
120 | + | |
121 | + return $this->redirectToRoute('candidato_index'); | |
122 | + } | |
123 | + | |
124 | + /** | |
125 | + * Creates a form to delete a candidato entity. | |
126 | + * | |
127 | + * @param candidato $candidato The candidato entity | |
128 | + * | |
129 | + * @return \Symfony\Component\Form\Form The form | |
130 | + */ | |
131 | + private function createDeleteForm(candidato $candidato) | |
132 | + { | |
133 | + return $this->createFormBuilder() | |
134 | + ->setAction($this->generateUrl('candidato_delete', array('id' => $candidato->getId()))) | |
135 | + ->setMethod('DELETE') | |
136 | + ->getForm() | |
137 | + ; | |
138 | + } | |
139 | +} | ... | ... |
src/UBV/PracticaBundle/Controller/estadoController.php
... | ... | @@ -0,0 +1,136 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Controller; | |
4 | + | |
5 | +use UBV\PracticaBundle\Entity\estado; | |
6 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
7 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
8 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request; | |
9 | + | |
10 | +/** | |
11 | + * Estado controller. | |
12 | + * | |
13 | + * @Route("estado") | |
14 | + */ | |
15 | +class estadoController extends Controller | |
16 | +{ | |
17 | + /** | |
18 | + * Lists all estado entities. | |
19 | + * | |
20 | + * @Route("/", name="estado_index") | |
21 | + * @Method("GET") | |
22 | + */ | |
23 | + public function indexAction() | |
24 | + { | |
25 | + $em = $this->getDoctrine()->getManager(); | |
26 | + | |
27 | + $estados = $em->getRepository('UBVPracticaBundle:estado')->findAll(); | |
28 | + | |
29 | + return $this->render('estado/index.html.twig', array( | |
30 | + 'estados' => $estados, | |
31 | + )); | |
32 | + } | |
33 | + | |
34 | + /** | |
35 | + * Creates a new estado entity. | |
36 | + * | |
37 | + * @Route("/new", name="estado_new") | |
38 | + * @Method({"GET", "POST"}) | |
39 | + */ | |
40 | + public function newAction(Request $request) | |
41 | + { | |
42 | + $estado = new Estado(); | |
43 | + $form = $this->createForm('UBV\PracticaBundle\Form\estadoType', $estado); | |
44 | + $form->handleRequest($request); | |
45 | + | |
46 | + if ($form->isSubmitted() && $form->isValid()) { | |
47 | + $em = $this->getDoctrine()->getManager(); | |
48 | + $em->persist($estado); | |
49 | + $em->flush(); | |
50 | + | |
51 | + return $this->redirectToRoute('estado_show', array('id' => $estado->getId())); | |
52 | + } | |
53 | + | |
54 | + return $this->render('estado/new.html.twig', array( | |
55 | + 'estado' => $estado, | |
56 | + 'form' => $form->createView(), | |
57 | + )); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * Finds and displays a estado entity. | |
62 | + * | |
63 | + * @Route("/{id}", name="estado_show") | |
64 | + * @Method("GET") | |
65 | + */ | |
66 | + public function showAction(estado $estado) | |
67 | + { | |
68 | + $deleteForm = $this->createDeleteForm($estado); | |
69 | + | |
70 | + return $this->render('estado/show.html.twig', array( | |
71 | + 'estado' => $estado, | |
72 | + 'delete_form' => $deleteForm->createView(), | |
73 | + )); | |
74 | + } | |
75 | + | |
76 | + /** | |
77 | + * Displays a form to edit an existing estado entity. | |
78 | + * | |
79 | + * @Route("/{id}/edit", name="estado_edit") | |
80 | + * @Method({"GET", "POST"}) | |
81 | + */ | |
82 | + public function editAction(Request $request, estado $estado) | |
83 | + { | |
84 | + $deleteForm = $this->createDeleteForm($estado); | |
85 | + $editForm = $this->createForm('UBV\PracticaBundle\Form\estadoType', $estado); | |
86 | + $editForm->handleRequest($request); | |
87 | + | |
88 | + if ($editForm->isSubmitted() && $editForm->isValid()) { | |
89 | + $this->getDoctrine()->getManager()->flush(); | |
90 | + | |
91 | + return $this->redirectToRoute('estado_edit', array('id' => $estado->getId())); | |
92 | + } | |
93 | + | |
94 | + return $this->render('estado/edit.html.twig', array( | |
95 | + 'estado' => $estado, | |
96 | + 'edit_form' => $editForm->createView(), | |
97 | + 'delete_form' => $deleteForm->createView(), | |
98 | + )); | |
99 | + } | |
100 | + | |
101 | + /** | |
102 | + * Deletes a estado entity. | |
103 | + * | |
104 | + * @Route("/{id}", name="estado_delete") | |
105 | + * @Method("DELETE") | |
106 | + */ | |
107 | + public function deleteAction(Request $request, estado $estado) | |
108 | + { | |
109 | + $form = $this->createDeleteForm($estado); | |
110 | + $form->handleRequest($request); | |
111 | + | |
112 | + if ($form->isSubmitted() && $form->isValid()) { | |
113 | + $em = $this->getDoctrine()->getManager(); | |
114 | + $em->remove($estado); | |
115 | + $em->flush(); | |
116 | + } | |
117 | + | |
118 | + return $this->redirectToRoute('estado_index'); | |
119 | + } | |
120 | + | |
121 | + /** | |
122 | + * Creates a form to delete a estado entity. | |
123 | + * | |
124 | + * @param estado $estado The estado entity | |
125 | + * | |
126 | + * @return \Symfony\Component\Form\Form The form | |
127 | + */ | |
128 | + private function createDeleteForm(estado $estado) | |
129 | + { | |
130 | + return $this->createFormBuilder() | |
131 | + ->setAction($this->generateUrl('estado_delete', array('id' => $estado->getId()))) | |
132 | + ->setMethod('DELETE') | |
133 | + ->getForm() | |
134 | + ; | |
135 | + } | |
136 | +} | ... | ... |
src/UBV/PracticaBundle/Controller/municipioController.php
... | ... | @@ -0,0 +1,136 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Controller; | |
4 | + | |
5 | +use UBV\PracticaBundle\Entity\municipio; | |
6 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
7 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
8 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request; | |
9 | + | |
10 | +/** | |
11 | + * Municipio controller. | |
12 | + * | |
13 | + * @Route("municipio") | |
14 | + */ | |
15 | +class municipioController extends Controller | |
16 | +{ | |
17 | + /** | |
18 | + * Lists all municipio entities. | |
19 | + * | |
20 | + * @Route("/", name="municipio_index") | |
21 | + * @Method("GET") | |
22 | + */ | |
23 | + public function indexAction() | |
24 | + { | |
25 | + $em = $this->getDoctrine()->getManager(); | |
26 | + | |
27 | + $municipios = $em->getRepository('UBVPracticaBundle:municipio')->findAll(); | |
28 | + | |
29 | + return $this->render('municipio/index.html.twig', array( | |
30 | + 'municipios' => $municipios, | |
31 | + )); | |
32 | + } | |
33 | + | |
34 | + /** | |
35 | + * Creates a new municipio entity. | |
36 | + * | |
37 | + * @Route("/new", name="municipio_new") | |
38 | + * @Method({"GET", "POST"}) | |
39 | + */ | |
40 | + public function newAction(Request $request) | |
41 | + { | |
42 | + $municipio = new Municipio(); | |
43 | + $form = $this->createForm('UBV\PracticaBundle\Form\municipioType', $municipio); | |
44 | + $form->handleRequest($request); | |
45 | + | |
46 | + if ($form->isSubmitted() && $form->isValid()) { | |
47 | + $em = $this->getDoctrine()->getManager(); | |
48 | + $em->persist($municipio); | |
49 | + $em->flush(); | |
50 | + | |
51 | + return $this->redirectToRoute('municipio_show', array('id' => $municipio->getId())); | |
52 | + } | |
53 | + | |
54 | + return $this->render('municipio/new.html.twig', array( | |
55 | + 'municipio' => $municipio, | |
56 | + 'form' => $form->createView(), | |
57 | + )); | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * Finds and displays a municipio entity. | |
62 | + * | |
63 | + * @Route("/{id}", name="municipio_show") | |
64 | + * @Method("GET") | |
65 | + */ | |
66 | + public function showAction(municipio $municipio) | |
67 | + { | |
68 | + $deleteForm = $this->createDeleteForm($municipio); | |
69 | + | |
70 | + return $this->render('municipio/show.html.twig', array( | |
71 | + 'municipio' => $municipio, | |
72 | + 'delete_form' => $deleteForm->createView(), | |
73 | + )); | |
74 | + } | |
75 | + | |
76 | + /** | |
77 | + * Displays a form to edit an existing municipio entity. | |
78 | + * | |
79 | + * @Route("/{id}/edit", name="municipio_edit") | |
80 | + * @Method({"GET", "POST"}) | |
81 | + */ | |
82 | + public function editAction(Request $request, municipio $municipio) | |
83 | + { | |
84 | + $deleteForm = $this->createDeleteForm($municipio); | |
85 | + $editForm = $this->createForm('UBV\PracticaBundle\Form\municipioType', $municipio); | |
86 | + $editForm->handleRequest($request); | |
87 | + | |
88 | + if ($editForm->isSubmitted() && $editForm->isValid()) { | |
89 | + $this->getDoctrine()->getManager()->flush(); | |
90 | + | |
91 | + return $this->redirectToRoute('municipio_edit', array('id' => $municipio->getId())); | |
92 | + } | |
93 | + | |
94 | + return $this->render('municipio/edit.html.twig', array( | |
95 | + 'municipio' => $municipio, | |
96 | + 'edit_form' => $editForm->createView(), | |
97 | + 'delete_form' => $deleteForm->createView(), | |
98 | + )); | |
99 | + } | |
100 | + | |
101 | + /** | |
102 | + * Deletes a municipio entity. | |
103 | + * | |
104 | + * @Route("/{id}", name="municipio_delete") | |
105 | + * @Method("DELETE") | |
106 | + */ | |
107 | + public function deleteAction(Request $request, municipio $municipio) | |
108 | + { | |
109 | + $form = $this->createDeleteForm($municipio); | |
110 | + $form->handleRequest($request); | |
111 | + | |
112 | + if ($form->isSubmitted() && $form->isValid()) { | |
113 | + $em = $this->getDoctrine()->getManager(); | |
114 | + $em->remove($municipio); | |
115 | + $em->flush(); | |
116 | + } | |
117 | + | |
118 | + return $this->redirectToRoute('municipio_index'); | |
119 | + } | |
120 | + | |
121 | + /** | |
122 | + * Creates a form to delete a municipio entity. | |
123 | + * | |
124 | + * @param municipio $municipio The municipio entity | |
125 | + * | |
126 | + * @return \Symfony\Component\Form\Form The form | |
127 | + */ | |
128 | + private function createDeleteForm(municipio $municipio) | |
129 | + { | |
130 | + return $this->createFormBuilder() | |
131 | + ->setAction($this->generateUrl('municipio_delete', array('id' => $municipio->getId()))) | |
132 | + ->setMethod('DELETE') | |
133 | + ->getForm() | |
134 | + ; | |
135 | + } | |
136 | +} | ... | ... |
src/UBV/PracticaBundle/Controller/pruebaedController.php
... | ... | @@ -0,0 +1,141 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Controller; | |
4 | + | |
5 | +use UBV\PracticaBundle\Entity\pruebaed; | |
6 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
7 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
8 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
9 | +use Symfony\Component\HttpFoundation\Request; | |
10 | + | |
11 | +/** | |
12 | + * Pruebaed controller. | |
13 | + * | |
14 | + * @Route("pruebaed") | |
15 | + */ | |
16 | +class pruebaedController extends Controller | |
17 | +{ | |
18 | + /** | |
19 | + * Lists all pruebaed entities. | |
20 | + * | |
21 | + * @Route("/", name="pruebaed_index") | |
22 | + * @Method("GET") | |
23 | + */ | |
24 | + public function indexAction() | |
25 | + { | |
26 | + $em = $this->getDoctrine()->getManager(); | |
27 | + | |
28 | + $pruebaeds = $em->getRepository('UBVPracticaBundle:pruebaed')->findAll(); | |
29 | + | |
30 | + return $this->render('pruebaed/index.html.twig', array( | |
31 | + 'pruebaeds' => $pruebaeds, | |
32 | + )); | |
33 | + } | |
34 | + | |
35 | + /** | |
36 | + * Creates a new pruebaed entity. | |
37 | + * | |
38 | + * @Route("/new", name="pruebaed_new") | |
39 | + * @Method({"GET", "POST"}) | |
40 | + */ | |
41 | + public function newAction(Request $request) | |
42 | + { | |
43 | + $pruebaed = new Pruebaed(); | |
44 | + $form = $this->createForm('UBV\PracticaBundle\Form\pruebaedType', $pruebaed); | |
45 | + $form->handleRequest($request); | |
46 | + | |
47 | + if ($form->isSubmitted() && $form->isValid()) { | |
48 | + $em = $this->getDoctrine()->getManager(); | |
49 | + $em->persist($pruebaed); | |
50 | + $em->flush(); | |
51 | + | |
52 | + $this->get('session')->getFlashBag()->set( 'success', array( 'title' => 'Guardado!', 'message' => 'Estado creado satisfactoriamente.' ) ); | |
53 | + | |
54 | + return $this->redirectToRoute('pruebaed_index', array('id' => $pruebaed->getId())); | |
55 | + } | |
56 | + | |
57 | + return $this->render('pruebaed/new.html.twig', array( | |
58 | + 'pruebaed' => $pruebaed, | |
59 | + 'form' => $form->createView(), | |
60 | + )); | |
61 | + } | |
62 | + | |
63 | + /** | |
64 | + * Finds and displays a pruebaed entity. | |
65 | + * | |
66 | + * @Route("/{id}", name="pruebaed_show") | |
67 | + * @Method("GET") | |
68 | + */ | |
69 | + public function showAction(pruebaed $pruebaed) | |
70 | + { | |
71 | + $deleteForm = $this->createDeleteForm($pruebaed); | |
72 | + | |
73 | + return $this->render('pruebaed/show.html.twig', array( | |
74 | + 'pruebaed' => $pruebaed, | |
75 | + 'delete_form' => $deleteForm->createView(), | |
76 | + )); | |
77 | + } | |
78 | + | |
79 | + /** | |
80 | + * Displays a form to edit an existing pruebaed entity. | |
81 | + * | |
82 | + * @Route("/{id}/edit", name="pruebaed_edit") | |
83 | + * @Method({"GET", "POST"}) | |
84 | + */ | |
85 | + public function editAction(Request $request, pruebaed $pruebaed) | |
86 | + { | |
87 | + $deleteForm = $this->createDeleteForm($pruebaed); | |
88 | + $editForm = $this->createForm('UBV\PracticaBundle\Form\pruebaedType', $pruebaed); | |
89 | + $editForm->handleRequest($request); | |
90 | + | |
91 | + if ($editForm->isSubmitted() && $editForm->isValid()) { | |
92 | + $this->getDoctrine()->getManager()->flush(); | |
93 | + | |
94 | + $this->get('session')->getFlashBag()->set( 'success', array( 'title' => 'Editado Satisfactoriamente!', 'message' => 'Estado creado satisfactoriamente.' ) ); | |
95 | + | |
96 | + return $this->redirectToRoute('pruebaed_index', array('id' => $pruebaed->getId())); | |
97 | + } | |
98 | + | |
99 | + return $this->render('pruebaed/edit.html.twig', array( | |
100 | + 'pruebaed' => $pruebaed, | |
101 | + 'edit_form' => $editForm->createView(), | |
102 | + 'delete_form' => $deleteForm->createView(), | |
103 | + )); | |
104 | + } | |
105 | + | |
106 | + /** | |
107 | + * Deletes a pruebaed entity. | |
108 | + * | |
109 | + * @Route("/{id}", name="pruebaed_delete") | |
110 | + * @Method("DELETE") | |
111 | + */ | |
112 | + public function deleteAction(Request $request, pruebaed $pruebaed) | |
113 | + { | |
114 | + $form = $this->createDeleteForm($pruebaed); | |
115 | + $form->handleRequest($request); | |
116 | + | |
117 | + if ($form->isSubmitted() && $form->isValid()) { | |
118 | + $em = $this->getDoctrine()->getManager(); | |
119 | + $em->remove($pruebaed); | |
120 | + $em->flush(); | |
121 | + } | |
122 | + | |
123 | + return $this->redirectToRoute('pruebaed_index'); | |
124 | + } | |
125 | + | |
126 | + /** | |
127 | + * Creates a form to delete a pruebaed entity. | |
128 | + * | |
129 | + * @param pruebaed $pruebaed The pruebaed entity | |
130 | + * | |
131 | + * @return \Symfony\Component\Form\Form The form | |
132 | + */ | |
133 | + private function createDeleteForm(pruebaed $pruebaed) | |
134 | + { | |
135 | + return $this->createFormBuilder() | |
136 | + ->setAction($this->generateUrl('pruebaed_delete', array('id' => $pruebaed->getId()))) | |
137 | + ->setMethod('DELETE') | |
138 | + ->getForm() | |
139 | + ; | |
140 | + } | |
141 | +} | ... | ... |
src/UBV/PracticaBundle/Entity/aldea.php
src/UBV/PracticaBundle/Entity/candidato.php
... | ... | @@ -0,0 +1,407 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Entity; | |
4 | + | |
5 | +use Doctrine\ORM\Mapping as ORM; | |
6 | + | |
7 | +/** | |
8 | + * candidato | |
9 | + * | |
10 | + * @ORM\Table(name="candidato") | |
11 | + * @ORM\Entity(repositoryClass="UBV\PracticaBundle\Repository\candidatoRepository") | |
12 | + */ | |
13 | +class candidato | |
14 | +{ | |
15 | + /** | |
16 | + * @var int | |
17 | + * | |
18 | + * @ORM\Column(name="id", type="integer") | |
19 | + * @ORM\Id | |
20 | + * @ORM\GeneratedValue(strategy="AUTO") | |
21 | + */ | |
22 | + private $id; | |
23 | + | |
24 | + /** | |
25 | + * @var string | |
26 | + * | |
27 | + * @ORM\Column(name="nombre", type="string", length=255) | |
28 | + */ | |
29 | + private $nombre; | |
30 | + | |
31 | + /** | |
32 | + * @var string | |
33 | + * | |
34 | + * @ORM\Column(name="apellido", type="string", length=255) | |
35 | + */ | |
36 | + private $apellido; | |
37 | + | |
38 | + /** | |
39 | + * @var int | |
40 | + * | |
41 | + * @ORM\Column(name="cedula", type="integer", unique=true) | |
42 | + */ | |
43 | + private $cedula; | |
44 | + | |
45 | + /** | |
46 | + * @var bool | |
47 | + * | |
48 | + * @ORM\Column(name="activo", type="boolean") | |
49 | + */ | |
50 | + private $activo; | |
51 | + | |
52 | + /** | |
53 | + * @var string | |
54 | + * | |
55 | + * @ORM\Column(name="instruccion", type="string", length=255) | |
56 | + */ | |
57 | + private $instruccion; | |
58 | + | |
59 | + /** | |
60 | + * @var string | |
61 | + * | |
62 | + * @ORM\Column(name="ocupacion", type="string", length=255) | |
63 | + */ | |
64 | + private $ocupacion; | |
65 | + | |
66 | + /** | |
67 | + * @var float | |
68 | + * | |
69 | + * @ORM\Column(name="promedio", type="float") | |
70 | + */ | |
71 | + private $promedio; | |
72 | + | |
73 | + /** | |
74 | + * @var string | |
75 | + * | |
76 | + * @ORM\Column(name="institucion", type="string", length=255) | |
77 | + */ | |
78 | + private $institucion; | |
79 | + | |
80 | + /** | |
81 | + * @var string | |
82 | + * | |
83 | + * @ORM\Column(name="pais", type="string", length=255) | |
84 | + */ | |
85 | + private $pais; | |
86 | + | |
87 | + /** | |
88 | + * @var string | |
89 | + * | |
90 | + * @ORM\Column(name="estado", type="string", length=255) | |
91 | + */ | |
92 | + private $estado; | |
93 | + | |
94 | + /** | |
95 | + * @var string | |
96 | + * | |
97 | + * @ORM\Column(name="municipio", type="string", length=255) | |
98 | + */ | |
99 | + private $municipio; | |
100 | + | |
101 | + /** | |
102 | + * @var string | |
103 | + * | |
104 | + * @ORM\Column(name="direccion", type="string", length=255) | |
105 | + */ | |
106 | + private $direccion; | |
107 | + | |
108 | + | |
109 | + /** | |
110 | + * Get id | |
111 | + * | |
112 | + * @return int | |
113 | + */ | |
114 | + public function getId() | |
115 | + { | |
116 | + return $this->id; | |
117 | + } | |
118 | + | |
119 | + /** | |
120 | + * Set nombre | |
121 | + * | |
122 | + * @param string $nombre | |
123 | + * | |
124 | + * @return candidato | |
125 | + */ | |
126 | + public function setNombre($nombre) | |
127 | + { | |
128 | + $this->nombre = $nombre; | |
129 | + | |
130 | + return $this; | |
131 | + } | |
132 | + | |
133 | + /** | |
134 | + * Get nombre | |
135 | + * | |
136 | + * @return string | |
137 | + */ | |
138 | + public function getNombre() | |
139 | + { | |
140 | + return $this->nombre; | |
141 | + } | |
142 | + | |
143 | + /** | |
144 | + * Set apellido | |
145 | + * | |
146 | + * @param string $apellido | |
147 | + * | |
148 | + * @return candidato | |
149 | + */ | |
150 | + public function setApellido($apellido) | |
151 | + { | |
152 | + $this->apellido = $apellido; | |
153 | + | |
154 | + return $this; | |
155 | + } | |
156 | + | |
157 | + /** | |
158 | + * Get apellido | |
159 | + * | |
160 | + * @return string | |
161 | + */ | |
162 | + public function getApellido() | |
163 | + { | |
164 | + return $this->apellido; | |
165 | + } | |
166 | + | |
167 | + /** | |
168 | + * Set cedula | |
169 | + * | |
170 | + * @param integer $cedula | |
171 | + * | |
172 | + * @return candidato | |
173 | + */ | |
174 | + public function setCedula($cedula) | |
175 | + { | |
176 | + $this->cedula = $cedula; | |
177 | + | |
178 | + return $this; | |
179 | + } | |
180 | + | |
181 | + /** | |
182 | + * Get cedula | |
183 | + * | |
184 | + * @return int | |
185 | + */ | |
186 | + public function getCedula() | |
187 | + { | |
188 | + return $this->cedula; | |
189 | + } | |
190 | + | |
191 | + /** | |
192 | + * Set activo | |
193 | + * | |
194 | + * @param boolean $activo | |
195 | + * | |
196 | + * @return candidato | |
197 | + */ | |
198 | + public function setActivo($activo) | |
199 | + { | |
200 | + $this->activo = $activo; | |
201 | + | |
202 | + return $this; | |
203 | + } | |
204 | + | |
205 | + /** | |
206 | + * Get activo | |
207 | + * | |
208 | + * @return bool | |
209 | + */ | |
210 | + public function getActivo() | |
211 | + { | |
212 | + return $this->activo; | |
213 | + } | |
214 | + | |
215 | + /** | |
216 | + * Set instruccion | |
217 | + * | |
218 | + * @param string $instruccion | |
219 | + * | |
220 | + * @return candidato | |
221 | + */ | |
222 | + public function setInstruccion($instruccion) | |
223 | + { | |
224 | + $this->instruccion = $instruccion; | |
225 | + | |
226 | + return $this; | |
227 | + } | |
228 | + | |
229 | + /** | |
230 | + * Get instruccion | |
231 | + * | |
232 | + * @return string | |
233 | + */ | |
234 | + public function getInstruccion() | |
235 | + { | |
236 | + return $this->instruccion; | |
237 | + } | |
238 | + | |
239 | + /** | |
240 | + * Set ocupacion | |
241 | + * | |
242 | + * @param string $ocupacion | |
243 | + * | |
244 | + * @return candidato | |
245 | + */ | |
246 | + public function setOcupacion($ocupacion) | |
247 | + { | |
248 | + $this->ocupacion = $ocupacion; | |
249 | + | |
250 | + return $this; | |
251 | + } | |
252 | + | |
253 | + /** | |
254 | + * Get ocupacion | |
255 | + * | |
256 | + * @return string | |
257 | + */ | |
258 | + public function getOcupacion() | |
259 | + { | |
260 | + return $this->ocupacion; | |
261 | + } | |
262 | + | |
263 | + /** | |
264 | + * Set promedio | |
265 | + * | |
266 | + * @param float $promedio | |
267 | + * | |
268 | + * @return candidato | |
269 | + */ | |
270 | + public function setPromedio($promedio) | |
271 | + { | |
272 | + $this->promedio = $promedio; | |
273 | + | |
274 | + return $this; | |
275 | + } | |
276 | + | |
277 | + /** | |
278 | + * Get promedio | |
279 | + * | |
280 | + * @return float | |
281 | + */ | |
282 | + public function getPromedio() | |
283 | + { | |
284 | + return $this->promedio; | |
285 | + } | |
286 | + | |
287 | + /** | |
288 | + * Set institucion | |
289 | + * | |
290 | + * @param string $institucion | |
291 | + * | |
292 | + * @return candidato | |
293 | + */ | |
294 | + public function setInstitucion($institucion) | |
295 | + { | |
296 | + $this->institucion = $institucion; | |
297 | + | |
298 | + return $this; | |
299 | + } | |
300 | + | |
301 | + /** | |
302 | + * Get institucion | |
303 | + * | |
304 | + * @return string | |
305 | + */ | |
306 | + public function getInstitucion() | |
307 | + { | |
308 | + return $this->institucion; | |
309 | + } | |
310 | + | |
311 | + /** | |
312 | + * Set pais | |
313 | + * | |
314 | + * @param string $pais | |
315 | + * | |
316 | + * @return candidato | |
317 | + */ | |
318 | + public function setPais($pais) | |
319 | + { | |
320 | + $this->pais = $pais; | |
321 | + | |
322 | + return $this; | |
323 | + } | |
324 | + | |
325 | + /** | |
326 | + * Get pais | |
327 | + * | |
328 | + * @return string | |
329 | + */ | |
330 | + public function getPais() | |
331 | + { | |
332 | + return $this->pais; | |
333 | + } | |
334 | + | |
335 | + /** | |
336 | + * Set estado | |
337 | + * | |
338 | + * @param string $estado | |
339 | + * | |
340 | + * @return candidato | |
341 | + */ | |
342 | + public function setEstado($estado) | |
343 | + { | |
344 | + $this->estado = $estado; | |
345 | + | |
346 | + return $this; | |
347 | + } | |
348 | + | |
349 | + /** | |
350 | + * Get estado | |
351 | + * | |
352 | + * @return string | |
353 | + */ | |
354 | + public function getEstado() | |
355 | + { | |
356 | + return $this->estado; | |
357 | + } | |
358 | + | |
359 | + /** | |
360 | + * Set municipio | |
361 | + * | |
362 | + * @param string $municipio | |
363 | + * | |
364 | + * @return candidato | |
365 | + */ | |
366 | + public function setMunicipio($municipio) | |
367 | + { | |
368 | + $this->municipio = $municipio; | |
369 | + | |
370 | + return $this; | |
371 | + } | |
372 | + | |
373 | + /** | |
374 | + * Get municipio | |
375 | + * | |
376 | + * @return string | |
377 | + */ | |
378 | + public function getMunicipio() | |
379 | + { | |
380 | + return $this->municipio; | |
381 | + } | |
382 | + | |
383 | + /** | |
384 | + * Set direccion | |
385 | + * | |
386 | + * @param string $direccion | |
387 | + * | |
388 | + * @return candidato | |
389 | + */ | |
390 | + public function setDireccion($direccion) | |
391 | + { | |
392 | + $this->direccion = $direccion; | |
393 | + | |
394 | + return $this; | |
395 | + } | |
396 | + | |
397 | + /** | |
398 | + * Get direccion | |
399 | + * | |
400 | + * @return string | |
401 | + */ | |
402 | + public function getDireccion() | |
403 | + { | |
404 | + return $this->direccion; | |
405 | + } | |
406 | +} | |
407 | + | ... | ... |
src/UBV/PracticaBundle/Entity/estado.php
src/UBV/PracticaBundle/Entity/estadoCivil.php
src/UBV/PracticaBundle/Entity/municipio.php
... | ... | @@ -35,6 +35,16 @@ class municipio |
35 | 35 | */ |
36 | 36 | private $codigo; |
37 | 37 | |
38 | + /** | |
39 | + * @var \Estado | |
40 | + * | |
41 | + * @ORM\ManyToOne(targetEntity="estado", inversedBy="municipios", cascade={"persist", "remove"}) | |
42 | + * @ORM\JoinColumn(name="estado_id", referencedColumnName="id", nullable=false) | |
43 | + * | |
44 | + * | |
45 | + */ | |
46 | + private $estado; | |
47 | + | |
38 | 48 | |
39 | 49 | /** |
40 | 50 | * Get id |
... | ... | @@ -93,5 +103,32 @@ class municipio |
93 | 103 | { |
94 | 104 | return $this->codigo; |
95 | 105 | } |
106 | + | |
107 | + /** | |
108 | + * Set estado | |
109 | + * | |
110 | + * @param \UBV\PracticaBundle\Entity\Estado $estado | |
111 | + * | |
112 | + * @return municipio | |
113 | + */ | |
114 | + public function setEstado(\UBV\PracticaBundle\Entity\Estado $estado=null) | |
115 | + { | |
116 | + $this->estado = $estado; | |
117 | + | |
118 | + return $this; | |
119 | + } | |
120 | + | |
121 | + /** | |
122 | + * Get estado | |
123 | + * | |
124 | + * @return \UBV\PracticaBundle\Entity\Estado | |
125 | + */ | |
126 | + public function getEstado() | |
127 | + { | |
128 | + return $this->estado; | |
129 | + } | |
130 | + | |
131 | + | |
132 | + | |
96 | 133 | } |
97 | 134 | ... | ... |
src/UBV/PracticaBundle/Entity/pruebaed.php
... | ... | @@ -0,0 +1,258 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Entity; | |
4 | + | |
5 | + | |
6 | + | |
7 | +use Doctrine\ORM\Mapping as ORM; | |
8 | +use Symfony\Component\Validator\Constraints as Assert; | |
9 | +use Symfony\Component\Validator\Constraints\NotBlank; | |
10 | +use Symfony\Component\Validator\Constraints\Length; | |
11 | + | |
12 | + | |
13 | + | |
14 | +/** | |
15 | + * pruebaed | |
16 | + * | |
17 | + * @ORM\Table(name="pruebaed") | |
18 | + * @ORM\Entity(repositoryClass="UBV\PracticaBundle\Repository\pruebaedRepository") | |
19 | + * | |
20 | + * | |
21 | + */ | |
22 | +class pruebaed | |
23 | +{ | |
24 | + /** | |
25 | + * @var int | |
26 | + * | |
27 | + * @ORM\Column(name="id", type="integer") | |
28 | + * @ORM\Id | |
29 | + * @ORM\GeneratedValue(strategy="AUTO") | |
30 | + */ | |
31 | + private $id; | |
32 | + | |
33 | + /** | |
34 | + * @Assert\NotNull(message= "Por favor introduzca su Nombre", groups={"Default"}) | |
35 | + * @Assert\NotBlank( message= "Por favor introduzca un Nombre valido", groups={"Default"}) | |
36 | + * @Assert\Length( | |
37 | + * min = 2, | |
38 | + * max = 45, | |
39 | + * minMessage = "Tu Nombre debe tener como minimo {{ limit }} letras", | |
40 | + * maxMessage = "Tu Nombre no debe exceder de {{ limit }} letras" | |
41 | + * ) | |
42 | + * @Assert\Regex( | |
43 | + * pattern="/\d/", | |
44 | + * match=false, | |
45 | + * message="Tu Nombre no debe contener numeros" | |
46 | + *) | |
47 | + * | |
48 | + * @var string | |
49 | + * | |
50 | + * @ORM\Column(name="nombre", type="string", length=50) | |
51 | + * | |
52 | + * | |
53 | + */ | |
54 | + private $nombre; | |
55 | + | |
56 | + /** | |
57 | + * @Assert\NotNull(message= "Por favor introduzca su Apellido", groups={"Default"}) | |
58 | + * @Assert\NotBlank( message= "Por favor introduzca su Apllido valido", groups={"Default"}) | |
59 | + * @Assert\Length( | |
60 | + * min = 2, | |
61 | + * max = 45, | |
62 | + * minMessage = "Tu Apellido debe tener como minimo {{ limit }} letras", | |
63 | + * maxMessage = "Tu Apellido no debe exceder de {{ limit }} letras" | |
64 | + * ) | |
65 | + * @Assert\Regex( | |
66 | + * pattern="/\d/", | |
67 | + * match=false, | |
68 | + * message="Tu Apellido no debe contener numeros" | |
69 | + *) | |
70 | + * | |
71 | + * @var string | |
72 | + * | |
73 | + * @ORM\Column(name="apellido", type="string", length=50) | |
74 | + */ | |
75 | + private $apellido; | |
76 | + | |
77 | + /** | |
78 | + * @Assert\NotNull(message= "Por favor introduzca su Cedula", groups={"Default"}) | |
79 | + * @Assert\NotBlank( message= "Por favor introduzca una Cedula valida", groups={"Default"}) | |
80 | + * @Assert\Length( | |
81 | + * min = 2, | |
82 | + * max = 45, | |
83 | + * minMessage = "Tu Cedula debe tener como minimo {{ limit }} numeros", | |
84 | + * maxMessage = "Tu Cedula no debe exceder de {{ limit }} numeros" | |
85 | + * ) | |
86 | + * | |
87 | + * | |
88 | + * @var int | |
89 | + * | |
90 | + * @ORM\Column(name="cedula", type="integer", unique=true) | |
91 | + */ | |
92 | + private $cedula; | |
93 | + | |
94 | + /** | |
95 | + * | |
96 | + * @Assert\NotNull(message= "Por favor introduzca su Edad", groups={"Default"}) | |
97 | + * @Assert\NotBlank( message= "Por favor introduzca una Edad valida", groups={"Default"}) | |
98 | + * @Assert\Length( | |
99 | + * min = 1, | |
100 | + * max = 3, | |
101 | + * minMessage = "Tu Edad debe tener como minimo {{ limit }} numeros", | |
102 | + * maxMessage = "Tu Edad no debe exceder de {{ limit }} numeros" | |
103 | + * ) | |
104 | + * | |
105 | + * @var int | |
106 | + * | |
107 | + * @ORM\Column(name="edad", type="integer") | |
108 | + */ | |
109 | + private $edad; | |
110 | + | |
111 | + /** | |
112 | + * @Assert\NotNull(message= "Por favor introduzca su Direccion", groups={"Default"}) | |
113 | + * @Assert\NotBlank( message= "Por favor introduzca una Direccion correcta", groups={"Default"}) | |
114 | + * @Assert\Length( | |
115 | + * min = 2, | |
116 | + * max = 150, | |
117 | + * minMessage = "Tu Direccion debe tener como minimo {{ limit }} numeros", | |
118 | + * maxMessage = "Tu Direccion no debe exceder de {{ limit }} numeros" | |
119 | + * ) | |
120 | + * | |
121 | + * @var string | |
122 | + * | |
123 | + * @ORM\Column(name="direccion", type="string", length=150) | |
124 | + */ | |
125 | + private $direccion; | |
126 | + | |
127 | + | |
128 | + /** | |
129 | + * Get id | |
130 | + * | |
131 | + * @return int | |
132 | + */ | |
133 | + public function getId() | |
134 | + { | |
135 | + return $this->id; | |
136 | + } | |
137 | + | |
138 | + /** | |
139 | + * Set nombre | |
140 | + * | |
141 | + * @param string $nombre | |
142 | + * | |
143 | + * @return pruebaed | |
144 | + */ | |
145 | + public function setNombre($nombre) | |
146 | + { | |
147 | + $this->nombre = $nombre; | |
148 | + | |
149 | + return $this; | |
150 | + } | |
151 | + | |
152 | + /** | |
153 | + * Get nombre | |
154 | + * | |
155 | + * @return string | |
156 | + */ | |
157 | + public function getNombre() | |
158 | + { | |
159 | + return $this->nombre; | |
160 | + } | |
161 | + | |
162 | + /** | |
163 | + * Set apellido | |
164 | + * | |
165 | + * @param string $apellido | |
166 | + * | |
167 | + * @return pruebaed | |
168 | + */ | |
169 | + public function setApellido($apellido) | |
170 | + { | |
171 | + $this->apellido = $apellido; | |
172 | + | |
173 | + return $this; | |
174 | + } | |
175 | + | |
176 | + /** | |
177 | + * Get apellido | |
178 | + * | |
179 | + * @return string | |
180 | + */ | |
181 | + public function getApellido() | |
182 | + { | |
183 | + return $this->apellido; | |
184 | + } | |
185 | + | |
186 | + /** | |
187 | + * Set cedula | |
188 | + * | |
189 | + * @param integer $cedula | |
190 | + * | |
191 | + * @return pruebaed | |
192 | + */ | |
193 | + public function setCedula($cedula) | |
194 | + { | |
195 | + $this->cedula = $cedula; | |
196 | + | |
197 | + return $this; | |
198 | + } | |
199 | + | |
200 | + /** | |
201 | + * Get cedula | |
202 | + * | |
203 | + * @return int | |
204 | + */ | |
205 | + public function getCedula() | |
206 | + { | |
207 | + return $this->cedula; | |
208 | + } | |
209 | + | |
210 | + /** | |
211 | + * Set edad | |
212 | + * | |
213 | + * @param integer $edad | |
214 | + * | |
215 | + * @return pruebaed | |
216 | + */ | |
217 | + public function setEdad($edad) | |
218 | + { | |
219 | + $this->edad = $edad; | |
220 | + | |
221 | + return $this; | |
222 | + } | |
223 | + | |
224 | + /** | |
225 | + * Get edad | |
226 | + * | |
227 | + * @return int | |
228 | + */ | |
229 | + public function getEdad() | |
230 | + { | |
231 | + return $this->edad; | |
232 | + } | |
233 | + | |
234 | + /** | |
235 | + * Set direccion | |
236 | + * | |
237 | + * @param string $direccion | |
238 | + * | |
239 | + * @return pruebaed | |
240 | + */ | |
241 | + public function setDireccion($direccion) | |
242 | + { | |
243 | + $this->direccion = $direccion; | |
244 | + | |
245 | + return $this; | |
246 | + } | |
247 | + | |
248 | + /** | |
249 | + * Get direccion | |
250 | + * | |
251 | + * @return string | |
252 | + */ | |
253 | + public function getDireccion() | |
254 | + { | |
255 | + return $this->direccion; | |
256 | + } | |
257 | +} | |
258 | + | ... | ... |
src/UBV/PracticaBundle/Form/candidatoType.php
... | ... | @@ -0,0 +1,48 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Form; | |
4 | + | |
5 | +use Symfony\Component\Form\AbstractType; | |
6 | +use Symfony\Component\Form\FormBuilderInterface; | |
7 | +use Symfony\Component\OptionsResolver\OptionsResolver; | |
8 | + | |
9 | +class candidatoType extends AbstractType | |
10 | +{ | |
11 | + /** | |
12 | + * {@inheritdoc} | |
13 | + */ | |
14 | + public function buildForm(FormBuilderInterface $builder, array $options) | |
15 | + { | |
16 | + $builder | |
17 | + ->add('nombre','text', array( 'label'=> 'Nombre', 'attr' => array('class' => 'form-control','placeholder'=>'Introduzca Nombre'), 'label_attr' => array('class' => 'control-label'),)) | |
18 | + ->add('apellido','text', array( 'label'=> 'Apellido', 'attr' => array('class' => 'form-control','placeholder'=>'Introduzca Apellido'), 'label_attr' => array('class' => 'control-label'),)) | |
19 | + ->add('cedula','integer', array( 'label'=> 'Cedula', 'attr' => array('class' => 'form-control','placeholder'=>'Ej.12345678'), 'label_attr' => array('class' => 'control-label'),)) | |
20 | + ->add('activo') | |
21 | + ->add('instruccion','text', array( 'label'=> 'Instruccion Academica', 'attr' => array('class' => 'form-control','placeholder'=>'Nivel Academico'), 'label_attr' => array('class' => 'control-label'),)) | |
22 | + ->add('ocupacion','text', array( 'label'=> 'Ocupacion/Profesion', 'attr' => array('class' => 'form-control','placeholder'=>'Ej. Carpintero'), 'label_attr' => array('class' => 'control-label'),)) | |
23 | + ->add('promedio','number', array( 'label'=> 'Promedio', 'attr' => array('class' => 'form-control','step'=>'0.01','placeholder'=>'Introduzca Promedio'), 'label_attr' => array('class' => 'control-label'),)) | |
24 | + ->add('institucion','text', array( 'label'=> 'Institucion', 'attr' => array('class' => 'form-control','placeholder'=>'Institucion/Universidad/Empresa'), 'label_attr' => array('class' => 'control-label'),)) | |
25 | + ->add('pais','text', array( 'label'=> 'Pais', 'attr' => array('class' => 'form-control','placeholder'=>'Seleccione'), 'label_attr' => array('class' => 'control-label'),)) | |
26 | + ->add('estado','text', array( 'label'=> 'Estado', 'attr' => array('class' => 'form-control','placeholder'=>'Estado'), 'label_attr' => array('class' => 'control-label'),)) | |
27 | + ->add('municipio','text', array( 'label'=> 'Municipio', 'attr' => array('class' => 'form-control','placeholder'=>'Municipio'), 'label_attr' => array('class' => 'control-label'),)) | |
28 | + ->add('direccion','text', array( 'label'=> 'Direccion', 'attr' => array('class' => 'form-control','placeholder'=>'Direccion de Domicilio'), 'label_attr' => array('class' => 'control-label'),)); | |
29 | + }/** | |
30 | + * {@inheritdoc} | |
31 | + */ | |
32 | + public function configureOptions(OptionsResolver $resolver) | |
33 | + { | |
34 | + $resolver->setDefaults(array( | |
35 | + 'data_class' => 'UBV\PracticaBundle\Entity\candidato' | |
36 | + )); | |
37 | + } | |
38 | + | |
39 | + /** | |
40 | + * {@inheritdoc} | |
41 | + */ | |
42 | + public function getBlockPrefix() | |
43 | + { | |
44 | + return 'ubv_practicabundle_candidato'; | |
45 | + } | |
46 | + | |
47 | + | |
48 | +} | ... | ... |
src/UBV/PracticaBundle/Form/estadoType.php
... | ... | @@ -0,0 +1,36 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Form; | |
4 | + | |
5 | +use Symfony\Component\Form\AbstractType; | |
6 | +use Symfony\Component\Form\FormBuilderInterface; | |
7 | +use Symfony\Component\OptionsResolver\OptionsResolver; | |
8 | + | |
9 | +class estadoType extends AbstractType | |
10 | +{ | |
11 | + /** | |
12 | + * {@inheritdoc} | |
13 | + */ | |
14 | + public function buildForm(FormBuilderInterface $builder, array $options) | |
15 | + { | |
16 | + $builder->add('descripcion')->add('codigo'); | |
17 | + }/** | |
18 | + * {@inheritdoc} | |
19 | + */ | |
20 | + public function configureOptions(OptionsResolver $resolver) | |
21 | + { | |
22 | + $resolver->setDefaults(array( | |
23 | + 'data_class' => 'UBV\PracticaBundle\Entity\estado' | |
24 | + )); | |
25 | + } | |
26 | + | |
27 | + /** | |
28 | + * {@inheritdoc} | |
29 | + */ | |
30 | + public function getBlockPrefix() | |
31 | + { | |
32 | + return 'ubv_practicabundle_estado'; | |
33 | + } | |
34 | + | |
35 | + | |
36 | +} | ... | ... |
src/UBV/PracticaBundle/Form/municipioType.php
... | ... | @@ -0,0 +1,36 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Form; | |
4 | + | |
5 | +use Symfony\Component\Form\AbstractType; | |
6 | +use Symfony\Component\Form\FormBuilderInterface; | |
7 | +use Symfony\Component\OptionsResolver\OptionsResolver; | |
8 | + | |
9 | +class municipioType extends AbstractType | |
10 | +{ | |
11 | + /** | |
12 | + * {@inheritdoc} | |
13 | + */ | |
14 | + public function buildForm(FormBuilderInterface $builder, array $options) | |
15 | + { | |
16 | + $builder->add('descripcion')->add('codigo')->add('estado'); | |
17 | + }/** | |
18 | + * {@inheritdoc} | |
19 | + */ | |
20 | + public function configureOptions(OptionsResolver $resolver) | |
21 | + { | |
22 | + $resolver->setDefaults(array( | |
23 | + 'data_class' => 'UBV\PracticaBundle\Entity\municipio' | |
24 | + )); | |
25 | + } | |
26 | + | |
27 | + /** | |
28 | + * {@inheritdoc} | |
29 | + */ | |
30 | + public function getBlockPrefix() | |
31 | + { | |
32 | + return 'ubv_practicabundle_municipio'; | |
33 | + } | |
34 | + | |
35 | + | |
36 | +} | ... | ... |
src/UBV/PracticaBundle/Form/pruebaedType.php
... | ... | @@ -0,0 +1,48 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Form; | |
4 | + | |
5 | +use Symfony\Component\Form\AbstractType; | |
6 | +use Symfony\Component\Form\FormBuilderInterface; | |
7 | +use Symfony\Component\OptionsResolver\OptionsResolver; | |
8 | + | |
9 | +class pruebaedType extends AbstractType | |
10 | +{ | |
11 | + /** | |
12 | + * {@inheritdoc} | |
13 | + */ | |
14 | + public function buildForm(FormBuilderInterface $builder, array $options) | |
15 | + { | |
16 | + $builder | |
17 | + ->add('nombre','text', array( 'label'=> 'Nombre', 'attr' => array('class' => 'form-control','placeholder'=>'Nombre'), 'label_attr' => array('class' => 'control-label'),)) | |
18 | + ->add('apellido','text', array( 'label'=> 'Apellido', 'attr' => array('class' => 'form-control','placeholder'=>'Apellido'), 'label_attr' => array('class' => 'control-label'),)) | |
19 | + ->add('cedula','integer', array( 'label'=> 'Cedula', 'attr' => array('class' => 'form-control','placeholder'=>'Ej. 12345678'), 'label_attr' => array('class' => 'control-label'),)) | |
20 | + ->add('edad','integer', array( 'label'=> 'Edad', 'attr' => array('class' => 'form-control','placeholder'=>'Ej. 1 - 100'), 'label_attr' => array('class' => 'control-label'),)) | |
21 | + ->add('direccion','textarea', array( 'label'=> 'Direccion', 'attr' => array('class' => 'form-control','placeholder'=>'Direccion'), 'label_attr' => array('class' => 'control-label'),)); | |
22 | + | |
23 | + /** | |
24 | + * | |
25 | + * ->add('nombre','text', array( 'label'=> 'Nombre', 'attr' => array('class' => 'form-control','placeholder'=>'Nombre'), 'label_attr' => array('class' => 'control-label'),)) | |
26 | + * | |
27 | + */ | |
28 | + | |
29 | + }/** | |
30 | + * {@inheritdoc} | |
31 | + */ | |
32 | + public function configureOptions(OptionsResolver $resolver) | |
33 | + { | |
34 | + $resolver->setDefaults(array( | |
35 | + 'data_class' => 'UBV\PracticaBundle\Entity\pruebaed' | |
36 | + )); | |
37 | + } | |
38 | + | |
39 | + /** | |
40 | + * {@inheritdoc} | |
41 | + */ | |
42 | + public function getBlockPrefix() | |
43 | + { | |
44 | + return 'ubv_practicabundle_pruebaed'; | |
45 | + } | |
46 | + | |
47 | + | |
48 | +} | ... | ... |
src/UBV/PracticaBundle/Repository/candidatoRepository.php
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Repository; | |
4 | + | |
5 | +/** | |
6 | + * candidatoRepository | |
7 | + * | |
8 | + * This class was generated by the Doctrine ORM. Add your own custom | |
9 | + * repository methods below. | |
10 | + */ | |
11 | +class candidatoRepository extends \Doctrine\ORM\EntityRepository | |
12 | +{ | |
13 | +} | ... | ... |
src/UBV/PracticaBundle/Repository/pruebaedRepository.php
... | ... | @@ -0,0 +1,13 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Repository; | |
4 | + | |
5 | +/** | |
6 | + * pruebaedRepository | |
7 | + * | |
8 | + * This class was generated by the Doctrine ORM. Add your own custom | |
9 | + * repository methods below. | |
10 | + */ | |
11 | +class pruebaedRepository extends \Doctrine\ORM\EntityRepository | |
12 | +{ | |
13 | +} | ... | ... |
src/UBV/PracticaBundle/Tests/Controller/candidatoControllerTest.php
... | ... | @@ -0,0 +1,55 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Tests\Controller; | |
4 | + | |
5 | +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
6 | + | |
7 | +class candidatoControllerTest extends WebTestCase | |
8 | +{ | |
9 | + /* | |
10 | + public function testCompleteScenario() | |
11 | + { | |
12 | + // Create a new client to browse the application | |
13 | + $client = static::createClient(); | |
14 | + | |
15 | + // Create a new entry in the database | |
16 | + $crawler = $client->request('GET', '/candidato/'); | |
17 | + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /candidato/"); | |
18 | + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); | |
19 | + | |
20 | + // Fill in the form and submit it | |
21 | + $form = $crawler->selectButton('Create')->form(array( | |
22 | + 'ubv_practicabundle_candidato[field_name]' => 'Test', | |
23 | + // ... other fields to fill | |
24 | + )); | |
25 | + | |
26 | + $client->submit($form); | |
27 | + $crawler = $client->followRedirect(); | |
28 | + | |
29 | + // Check data in the show view | |
30 | + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); | |
31 | + | |
32 | + // Edit the entity | |
33 | + $crawler = $client->click($crawler->selectLink('Edit')->link()); | |
34 | + | |
35 | + $form = $crawler->selectButton('Update')->form(array( | |
36 | + 'ubv_practicabundle_candidato[field_name]' => 'Foo', | |
37 | + // ... other fields to fill | |
38 | + )); | |
39 | + | |
40 | + $client->submit($form); | |
41 | + $crawler = $client->followRedirect(); | |
42 | + | |
43 | + // Check the element contains an attribute with value equals "Foo" | |
44 | + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); | |
45 | + | |
46 | + // Delete the entity | |
47 | + $client->submit($crawler->selectButton('Delete')->form()); | |
48 | + $crawler = $client->followRedirect(); | |
49 | + | |
50 | + // Check the entity has been delete on the list | |
51 | + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); | |
52 | + } | |
53 | + | |
54 | + */ | |
55 | +} | ... | ... |
src/UBV/PracticaBundle/Tests/Controller/estadoControllerTest.php
... | ... | @@ -0,0 +1,55 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Tests\Controller; | |
4 | + | |
5 | +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
6 | + | |
7 | +class estadoControllerTest extends WebTestCase | |
8 | +{ | |
9 | + /* | |
10 | + public function testCompleteScenario() | |
11 | + { | |
12 | + // Create a new client to browse the application | |
13 | + $client = static::createClient(); | |
14 | + | |
15 | + // Create a new entry in the database | |
16 | + $crawler = $client->request('GET', '/estado/'); | |
17 | + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /estado/"); | |
18 | + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); | |
19 | + | |
20 | + // Fill in the form and submit it | |
21 | + $form = $crawler->selectButton('Create')->form(array( | |
22 | + 'ubv_practicabundle_estado[field_name]' => 'Test', | |
23 | + // ... other fields to fill | |
24 | + )); | |
25 | + | |
26 | + $client->submit($form); | |
27 | + $crawler = $client->followRedirect(); | |
28 | + | |
29 | + // Check data in the show view | |
30 | + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); | |
31 | + | |
32 | + // Edit the entity | |
33 | + $crawler = $client->click($crawler->selectLink('Edit')->link()); | |
34 | + | |
35 | + $form = $crawler->selectButton('Update')->form(array( | |
36 | + 'ubv_practicabundle_estado[field_name]' => 'Foo', | |
37 | + // ... other fields to fill | |
38 | + )); | |
39 | + | |
40 | + $client->submit($form); | |
41 | + $crawler = $client->followRedirect(); | |
42 | + | |
43 | + // Check the element contains an attribute with value equals "Foo" | |
44 | + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); | |
45 | + | |
46 | + // Delete the entity | |
47 | + $client->submit($crawler->selectButton('Delete')->form()); | |
48 | + $crawler = $client->followRedirect(); | |
49 | + | |
50 | + // Check the entity has been delete on the list | |
51 | + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); | |
52 | + } | |
53 | + | |
54 | + */ | |
55 | +} | ... | ... |
src/UBV/PracticaBundle/Tests/Controller/municipioControllerTest.php
... | ... | @@ -0,0 +1,55 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Tests\Controller; | |
4 | + | |
5 | +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
6 | + | |
7 | +class municipioControllerTest extends WebTestCase | |
8 | +{ | |
9 | + /* | |
10 | + public function testCompleteScenario() | |
11 | + { | |
12 | + // Create a new client to browse the application | |
13 | + $client = static::createClient(); | |
14 | + | |
15 | + // Create a new entry in the database | |
16 | + $crawler = $client->request('GET', '/municipio/'); | |
17 | + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /municipio/"); | |
18 | + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); | |
19 | + | |
20 | + // Fill in the form and submit it | |
21 | + $form = $crawler->selectButton('Create')->form(array( | |
22 | + 'ubv_practicabundle_municipio[field_name]' => 'Test', | |
23 | + // ... other fields to fill | |
24 | + )); | |
25 | + | |
26 | + $client->submit($form); | |
27 | + $crawler = $client->followRedirect(); | |
28 | + | |
29 | + // Check data in the show view | |
30 | + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); | |
31 | + | |
32 | + // Edit the entity | |
33 | + $crawler = $client->click($crawler->selectLink('Edit')->link()); | |
34 | + | |
35 | + $form = $crawler->selectButton('Update')->form(array( | |
36 | + 'ubv_practicabundle_municipio[field_name]' => 'Foo', | |
37 | + // ... other fields to fill | |
38 | + )); | |
39 | + | |
40 | + $client->submit($form); | |
41 | + $crawler = $client->followRedirect(); | |
42 | + | |
43 | + // Check the element contains an attribute with value equals "Foo" | |
44 | + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); | |
45 | + | |
46 | + // Delete the entity | |
47 | + $client->submit($crawler->selectButton('Delete')->form()); | |
48 | + $crawler = $client->followRedirect(); | |
49 | + | |
50 | + // Check the entity has been delete on the list | |
51 | + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); | |
52 | + } | |
53 | + | |
54 | + */ | |
55 | +} | ... | ... |
src/UBV/PracticaBundle/Tests/Controller/pruebaedControllerTest.php
... | ... | @@ -0,0 +1,55 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace UBV\PracticaBundle\Tests\Controller; | |
4 | + | |
5 | +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
6 | + | |
7 | +class pruebaedControllerTest extends WebTestCase | |
8 | +{ | |
9 | + /* | |
10 | + public function testCompleteScenario() | |
11 | + { | |
12 | + // Create a new client to browse the application | |
13 | + $client = static::createClient(); | |
14 | + | |
15 | + // Create a new entry in the database | |
16 | + $crawler = $client->request('GET', '/pruebaed/'); | |
17 | + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /pruebaed/"); | |
18 | + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); | |
19 | + | |
20 | + // Fill in the form and submit it | |
21 | + $form = $crawler->selectButton('Create')->form(array( | |
22 | + 'ubv_practicabundle_pruebaed[field_name]' => 'Test', | |
23 | + // ... other fields to fill | |
24 | + )); | |
25 | + | |
26 | + $client->submit($form); | |
27 | + $crawler = $client->followRedirect(); | |
28 | + | |
29 | + // Check data in the show view | |
30 | + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); | |
31 | + | |
32 | + // Edit the entity | |
33 | + $crawler = $client->click($crawler->selectLink('Edit')->link()); | |
34 | + | |
35 | + $form = $crawler->selectButton('Update')->form(array( | |
36 | + 'ubv_practicabundle_pruebaed[field_name]' => 'Foo', | |
37 | + // ... other fields to fill | |
38 | + )); | |
39 | + | |
40 | + $client->submit($form); | |
41 | + $crawler = $client->followRedirect(); | |
42 | + | |
43 | + // Check the element contains an attribute with value equals "Foo" | |
44 | + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); | |
45 | + | |
46 | + // Delete the entity | |
47 | + $client->submit($crawler->selectButton('Delete')->form()); | |
48 | + $crawler = $client->followRedirect(); | |
49 | + | |
50 | + // Check the entity has been delete on the list | |
51 | + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); | |
52 | + } | |
53 | + | |
54 | + */ | |
55 | +} | ... | ... |