| @@ 45-70 (lines=26) @@ | ||
| 42 | * |
|
| 43 | * @return Response |
|
| 44 | */ |
|
| 45 | public function cachesController_index(Request $request) |
|
| 46 | : Response { |
|
| 47 | $fetchedCaches = ''; |
|
| 48 | ||
| 49 | // create input field for caches_by_searchfield |
|
| 50 | $form = $this->createForm(CachesFormType::class); |
|
| 51 | ||
| 52 | // see: https://symfonycasts.com/screencast/symfony-forms/form-submit |
|
| 53 | // handles the request (submit-button of the form), but only if there is a POST request |
|
| 54 | $form->handleRequest($request); |
|
| 55 | // if is true only if there is a request submitted and it is valid |
|
| 56 | if ($form->isSubmitted() && $form->isValid()) { |
|
| 57 | // read content of form input field |
|
| 58 | $inputData = $form->getData(); |
|
| 59 | ||
| 60 | // send request to DB |
|
| 61 | $fetchedCaches = $this->getCachesForSearchField($inputData['content_caches_searchfield']); |
|
| 62 | } |
|
| 63 | ||
| 64 | return $this->render( |
|
| 65 | 'backend/caches/basicview.html.twig', [ |
|
| 66 | 'cachesForm' => $form->createView(), |
|
| 67 | 'caches_by_searchfield' => $fetchedCaches |
|
| 68 | ] |
|
| 69 | ); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * @param string $wpID |
|
| @@ 42-57 (lines=16) @@ | ||
| 39 | * |
|
| 40 | * @return Response |
|
| 41 | */ |
|
| 42 | public function coordinatesController_index(Request $request) |
|
| 43 | : Response { |
|
| 44 | $fetchedCoordinates = ''; |
|
| 45 | $form = $this->createForm(CoordinatesFormType::class); |
|
| 46 | ||
| 47 | $form->handleRequest($request); |
|
| 48 | if ($form->isSubmitted() && $form->isValid()) { |
|
| 49 | $inputData = $form->getData(); |
|
| 50 | ||
| 51 | $fetchedCoordinates = $this->getCoordinatesForSearchField($inputData['content_coordinates_searchfield']); |
|
| 52 | } |
|
| 53 | ||
| 54 | return $this->render( |
|
| 55 | 'backend/coordinates/index.html.twig', ['coordinatesForm' => $form->createView(), 'coordinates_by_searchfield' => $fetchedCoordinates] |
|
| 56 | ); |
|
| 57 | } |
|
| 58 | ||
| 59 | /** |
|
| 60 | * @param string $lat |
|