Skip to content

Comparison API #487

Discussion options

You must be logged in to vote

Actually what you're describing should already be possible—Ziggy uses the window by default but if you pass it a config that includes a location object it will use that instead, that's what lines 113-115 of the snippet you included are doing.

This was added in #432 to support server side rendering, but I think it'll work for you. Try something like this:

route(undefined, undefined, undefined, {
  ...Ziggy,
  location: {
    host: 'example.com',
    pathname: '/task/1',
  },
}).current('tasks.show');

You could wrap that in a helper or something if you need to do it often.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by bakerkretzmar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #485 on December 13, 2021 00:35.