symfony 3 route not found for login/ register - symfony

I dont use FOS
What is wrong? My links directs to "login" and "register" and I am getting this:
No route found for "GET /login/"
Also getting this for register
No route found for "GET /register/"
My debug:router looks like:
Entity and Controller are in UserBundle routing.yml:

Because You did pass this:
# app/config/routing.yml
fos_user:
resource: "#FOSUserBundle/Resources/config/routing/all.xml"
If you use 2 > version FOSUserBundle
# app/config/routing.yml
fos_user_security:
resource: "#FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "#FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /profile
fos_user_register:
resource: "#FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register
fos_user_resetting:
resource: "#FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting
fos_user_change_password:
resource: "#FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /profile
I would recommend you to read this documentation: https://symfony.com/doc/current/bundles/FOSUserBundle/index.html

Related

Symfony redirects - routers.yaml before annotations.yaml

I'm using annotations in my project but to redirects using routes.yaml
If exists routing (ex. /home name="home"} that redirect not working:
home-301:
path: /home
defaults:
_controller: FrameworkBundle:Redirect:urlRedirect
path: /new-home
permanent: true
I found solution but I thing it is no good practice:
cleared: config/routes/annotations.yaml
and appended to the end of the file config/routes.yaml:
controllers:
resource: ../../src/Controller/
type: annotation
how to do it right?
My solution:
all redirects put in: config/routers/redirects.yaml
and config/routes.yaml:
redirects:
resource: routes/redirects.yaml
annotations:
resource: routes/annotations.yaml

Sonata User Bundle error on profile edit

I configure a symfony 2.7 installation with the lasted sonata admin and sonata user bundles. My backend work well, also work /profile page, but I'm getting this error in /profile/edit-profile and /profile/edit-authentication :
Unable to find template "MopaBootstrapBundle:Form:fields.html.twig" in SonataUserBundle:ChangePassword:changePassword_content.html.twig at line 2.
this is my config.yml
fos_user:
...
profile:
form:
type: fos_user_profile
handler: fos_user.profile.form.handler.default
name: fos_user_profile_form
validation_groups: [Authentication]
sonata_user:
...
profile: # Profile Form (firstname, lastname, etc ...)
form:
type: sonata_user_profile
handler: sonata.user.profile.form.handler.default
name: sonata_user_profile_form
validation_groups: [Profile]
and some routes:
sonata_user_resetting:
resource: "#SonataUserBundle/Resources/config/routing/sonata_resetting_1.xml"
prefix: /resetting
sonata_user_profile:
resource: "#SonataUserBundle/Resources/config/routing/sonata_profile_1.xml"
prefix: /profile
sonata_user_change_password:
resource: "#SonataUserBundle/Resources/config/routing/sonata_change_password_1.xml"
prefix: /profile
Also look for that template mention in that twig file but I don't see it.
Any help will be apreciated.
Finally I find the solution installing mopa bootsrap bundle and configure it.

when i log in my prod env it crashesw with "500 Internal server error" in symfony2

I'm working with Symfony2.3.4 and PHP5.6.3
This happens only when I AM LOGGED IN PROD ENV, while I'm not or when I'm in dev env(logged or not) nothing bad happens, I can go anywhere in my site(security is not implemented yet).
Has anyone run into this issue already? I really don't know what other info you'd need to help me, please feel free to yell back for extra info.
routing.yml
homepage:
pattern: /homepage/
defaults: { _controller: GCBundle:Default:homepage }
UserBundle:
resource: "#UserBundle/Resources/config/routing.yml"
prefix: /user/
GCBundle:
resource: "#GCBundle/Resources/config/routing.yml"
prefix: /gc/
ReportsBundle:
resource: "#ReportsBundle/Resources/config/routing.yml"
prefix: /reports/
routing_dev.yml
_wdt:
resource: "#WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
_profiler:
resource: "#WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /_profiler
_configurator:
resource: "#SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
prefix: /_configurator
_main:
resource: routing.yml
#AcmeDemoBundle routes (to be removed)
_acme_demo:
resource: "#AcmeDemoBundle/Resources/config/routing.yml"
thanks

In Symfony 2, how do I handle routing for multiple domains?

I have my app setup to use 3 subdomains, I also have 2 domains that point to the same app, giving me this set of FQDNs
admin.domain1.com, admin.domain2.com
www.domain1.com, www.domain2.com
kiosk.domain1.com, kiosk.domain2.com
In routing.yml I can set up the host / resource keys to point those domains at the relevant bundle, but I can only do it for one of the domains at a time.
incompass_admin:
host: admin.domain1.com
resource: "#IncompassAdminBundle/Resources/config/routes.yml"
incompass_web:
host: www.domain1.com
resource: "#IncompassWebBundle/Resources/config/routes.yml"
incompass_kiosk:
host: kiosk.domain1.com
resource: "#IncompassKioskBundle/Resources/config/routes.yml"
When I try something like this
incompass_kiosk_1:
host: kiosk.domain1.com
resource: "#IncompassKioskBundle/Resources/config/routes.yml"
incompass_kiosk_2:
host: kiosk.domain2.com
resource: "#IncompassKioskBundle/Resources/config/routes.yml"
The second domain is the only one that is recognised, kiosk.domain1.com throws an exception: No route found for "GET /"
Is there a way to either set the domain as a wildcard in routing.yml, or to point 2 different routes to the same resource?
edit: I've also tried to have
IncompassKioskBundle/Resources/config/routes_1.yml
IncompassKioskBundle/Resources/config/routes_2.yml
and
IncompassKioskBundle/Resources/config/routes.yml
IncompassRoutingBundle/Resources/config/kiosk_routes.yml
where the names of the routes in the 2 files are different e.g.
// routes.yml
domain_one_kiosk_scanning:
type: annotation
prefix: /
resource: Incompass\KioskBundle\Controller\ScanningController
domain_one_kiosk_printing:
type: annotation
prefix: /print
resource: Incompass\KioskBundle\Controller\PrintingController
// kiosk_routes.yml
domain_two_kiosk_scanning:
type: annotation
prefix: /
resource: Incompass\KioskBundle\Controller\ScanningController
domain_two_kiosk_printing:
type: annotation
prefix: /print
resource: Incompass\KioskBundle\Controller\PrintingController
That did not work.
You can use placeholders in routes, so try something like this:
incompass_kiosk:
host: "kiosk.{domain}.com"
resource: "#IncompassKioskBundle/Resources/config/routes.yml"
requirements:
domain: domain1|domain2
defaults: { domain: domain1 }
You could alternatively handle this in your .htaccess or virtual host configuration.

No route found for "GET /connect"

Trying to use HWIOAuthBundle
No route found for "GET /connect"
404 Not Found - NotFoundHttpException
1 linked Exception: ResourceNotFoundException ยป
https://gist.github.com/idlweb/6232475
try to import more bundle routes into your app routing, not only the redirect.xml:
hwi_oauth_security:
resource: "#HWIOAuthBundle/Resources/config/routing/login.xml"
prefix: /connect
hwi_oauth_connect:
resource: "#HWIOAuthBundle/Resources/config/routing/connect.xml"
prefix: /connect
hwi_oauth_redirect:
resource: "#HWIOAuthBundle/Resources/config/routing/redirect.xml"
prefix: /connect

Resources