nicolasbeauvais / Walrus

Walrus Framework - Certainly not that big whatever factory.
https://walrus.herokuapp.com
MIT License
46 stars 6 forks source link

Routing #52

Closed FaustineLarmagna closed 10 years ago

FaustineLarmagna commented 10 years ago

With a link like this :

<a href="{{id}}/delete">

When url is like this :

Localhost/ProjectName/project

Sometimes direct to "Localhost/ProjectName/project/1/delete" And sometimes to .... "Localhost/ProjectName/project/project/1/delete"

Randomly. (really randomly or not ?)

nicolasbeauvais commented 10 years ago

Hello.

Assuming you are on a link http:///mywebsite.com/test/

In HTML when you make a link without starting it with a slash like this

<a href="hello/world">

It will be added to the current url: http:///mywebsite.com/test/hello/world

If you start your link with a slash like this

<a href="/hello/world">

It will be added to the domain name without the rest of the previous url: http:///mywebsite.com/hello/world

This is the basic browser behavior and have nothing to do with any PHP code.

More informations about how to make HTML link: http://www.w3schools.com/tags/tag_a.asp

Regards.

FaustineLarmagna commented 10 years ago

Wrong explanation on my side :

With a link like this :

When url is like this : Localhost/ProjectName/project

Sometimes direct to "Localhost/ProjectName/project/1/delete" And sometimes to .... "Localhost/ProjectName/1/delete"

So I added /project in href and then sometimes

Sometimes direct to "Localhost/ProjectName/project/1/delete" And sometimes to .... "Localhost/ProjectName/project/project/1/delete"

Wtf indeed.