Routing Name does not work with multiple words

I created the route:
It works when it is one word but it does not show the query result when it is more than one.

For example:

https:domain.com/bp/myown - work
But
https:domain.com/bp/myown-business - does not work

I don’t know what is missing here.

Capture2

image

Hi,
The GET param should be like $_GET.id_business instead of $_GET.businessid I think.
Having hyphenated name in the parameter value should not cause any issues.

I changed it - It is not working at all.

What’s the server model here?
Also, can you share a link to this?

php -

https://1connect1.com/index.php

When you click on the name of the business: You will see

Should Like put

contain

instead of

=

Not sure what that means.

Tried two businesses. This is what I see:
image
image

Both routes & params look fine. What the issue here??

P.S. There is something wrong with your logic. You are loading 4MB+ data via server connect. You should not need that much data to be downloaded unless this is a really specific use-case which needs that.

You are sending this to your server action:

?businessid=robert-barnes-and-associates-inc

are you using businessid GET variable to filter the database? What is the content of the column you are trying to filter by?

https://1connect1.com/bp/transcending-eye-care

Business info:

I mean business name. SOrry

Sorry, that does not make sense either.
For a business named “College Park Eye Care”, the URL is https://1connect1.com/bp/college-park-eye-care.
What do you have in Business_Name field in the DB for this particular business?

Well if you store your business names in the database like: my business name it will never match the value you are sending my-business-name

https://1connect1.com/bp/serevene

https://1connect1.com/bp/churchills-barber-shop

Try the two links

You are comparing:

some-name with some name and they are NOT equal.

True.
Mean I have to send the name first with dash before displaying.
But what about if I use the id only but want the url to be cleaned

What do you suggest?
Url has the slugify element as you recommended in one the post.

Try using the humanize formatter to the value you are sending to the GET param:

<dmx-serverconnect id="serverconnect1" url="../../dmxConnect/api/Security/Search/BusinessProfile.php" dmx-param:businessid="query.id_business.humanize()" dmx-param:album="" dmx-param:servicecategory="form1.input1_group.value"

usually you send the uniquer business ID with the URL as well and use it to filter the records, so you don’t have issues with sending slugified value back to the db.

I did the humanize option;

https://1connect1.com/bp/the-shave-barbershop (does work)

https://1connect1.com/bp/musas-accounting-service (doesnot work) - ### Musa’s Accounting Service

Anything with the special characters such as & or ’ does not work.

What do you think about it?

That’s because humanize replaces them.
Maybe use replace instead of humanize …

dmx-param:businessid="query.id_business.replace('-', ' ')"

which will fix this problem.

But the most clear and error-proof way would be to send the unique record ID in the URL so you are using it to filter the records, not the name, like:

https://1connect1.com/bp/2/musas-accounting-service

then it won’t matter in what way is the text transformed in the URL.

So, I changed the url to https://1connect1.com/bp/72/lifetime-eyecare/

but the route path is /bp/:id_business/

so, I am not getting the page