admin管理员组文章数量:1125111
When deploying to Docker, routes work fine but when I deploy to gcloud App Engine, clicking on the submit button returns to /search
(the search bar route), anybody knows why?
<div class="search-bar">
{{ form_start(form, {'method': 'POST', 'action': path('app_search')}) }}
<div class="search-bar-inner">
[...]
<div class="form-field form-field-localisation">
<div class="select-wrapper select-ajax select-wrapper-icon">
<i class="icon icon-text-2 icon-35">
{% include "svg.twig/icon-locate.svg.twig" %}
</i>
{{ form_widget(form.location) }}
</div>
</div>
<div class="form-field form-field-radius">
<div class="select-wrapper">
{{ form_widget(form.radius) }}
</div>
</div>
{{ form_rest(form) }}
<input type="submit" class="btn btn-site-1" value="trouver">
</div>
{{ form_end(form) }}
</div>
SearchBar Controller:
/**
* @param Request $request
* @param ActivitySectorHandler $activitySectorHandler
* @return RedirectResponse|Response
*/
#[Route(path: 'search', name: 'app_search')]
public function search(Request $request, ActivitySectorHandler $activitySectorHandler ): RedirectResponse|Response
{
/** @var Session $session */
$session = $request->getSession();
$sessionJob = $session->get('sessionJob');
$sessionLocation = $session->get('sessionLocation');
$sessionRadius = $session->get('sessionRadius');
$activitySector = $activitySectorHandler->getActivitySector();
/** @var Activity $activities */
$activities = $this->entityManager->getRepository(Activity::class)
->findByActivitySector($activitySector);
/** @var Form $form */
$form = $this->createForm(SearchType::class, null, [
'sessionJob' => $sessionJob,
'sessionLocation' => $sessionLocation,
'sessionRadius' => $sessionRadius,
'activitySector' => $activitySector,
]);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$data = $form->getData();
$session->set('sessionLocation', $data['location']);
$session->set('sessionRadius', $data['radius']);
$activitySectorSlug = $session->get('activitySectorSlug');
return $this->redirectToRoute('app_search_offer_result', [
'activitySectorSlug' => $activitySectorSlug,
'job' => $data['job'],
'city' => json_decode((string) $data['location'], true)['city'],
'pageNumber' => 1,
]);
}
return $this->render("search/searchBar.html.twig", [
'form' => $form,
'activities' => $activities,
'activitySector' => $activitySector,
]);
}
No js, no css is loaded I'm having trouble debugging App Engine
I checked routes in local prod and dev env, docker prod and dev env, submit button redirects correctly to app_search_offer_result
本文标签: Why is App Engine not reading Symfony routesStack Overflow
版权声明:本文标题:Why is App Engine not reading Symfony routes - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736640635a1945986.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论