cancel
Showing results for 
Search instead for 
Did you mean: 

Why a "> Three Character" FrontName Limit?

SOLVED

Why a "> Three Character" FrontName Limit?

What's the reasoning behind forcing router front names to have three or more characters?

 

Invalid XML in file /path/to/magento2/app/code/Pulsestorm/HelloPestle/etc/frontend/routes.xml:
Element 'route', attribute 'id': [facet 'pattern'] The value 
'hello-world' is not accepted by the pattern '[A-Za-z0-9_]{3,}'.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Why a "> Three Character" FrontName Limit?

Sorry, trying go catch up with old requests. I have not found any solid reason - I think its a bug. It is possible an internal "style rule" got translated into "prohibit it from happening", which is an unnecessary restriction in practice. If it has not been fixed already feel free to raise in GitHub as an issue (so you get updates when fixed). I do recall a discussion a while back on this or a similar issue and no real reason was raised.

View solution in original post

3 REPLIES 3

Re: Why a "> Three Character" FrontName Limit?

I need to dig around for this one. I recall there was a reason, but it has slipped my mind right now. Is there a problem caused by this or were you just curious?

Re: Why a "> Three Character" FrontName Limit?

Both?  I wanted a URL that looked something like this

 

    http://example.magento.com/me/foo/baz

 

However, with the current restrictions in place, I can't create that sort of URL without going the custom router object route, which seems like a lot of extra work/potential system instability for a simple URL endpoint.  So this is really something I need.

 

However, I'm also curious as to the reasoning behind it.  Because it SEEMS like one of those obvious minor-but-important details that's missed in the rush to getting a 1.0 (err, 2.0) out the door, but I wasn't in the room when those decisions were made, so I'm curious if there's an actual solid reason for doing this.

Re: Why a "> Three Character" FrontName Limit?

Sorry, trying go catch up with old requests. I have not found any solid reason - I think its a bug. It is possible an internal "style rule" got translated into "prohibit it from happening", which is an unnecessary restriction in practice. If it has not been fixed already feel free to raise in GitHub as an issue (so you get updates when fixed). I do recall a discussion a while back on this or a similar issue and no real reason was raised.