> For the complete documentation index, see [llms.txt](https://freeseamew.gitbook.io/svelte/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freeseamew.gitbook.io/svelte/8.-routify/parameter.md).

# parameter 전달 및 받기

### parameter 전달 방법

#### 전달 링크 생성

값 전달을 할 링크는 다음과 같이 object(객체)를 만들어 전달 할 수 있습니다. 아래 예제로 만든 링크는 `[localhost:5000/blog/123](<http://localhost:5000/blog/123>)` 의 형태로 생성됩니다.

```
<a href={$url('/blog/:id', {id: '123'} )} }>Blog</a>
```

#### 전달된 파라미터 받는 방법

앞에서 잠깐 설명 한 것 처럼 값을 받기 위해서는 폴더 내에 파일 이름을 전달받는 파라미터이름을 \[]로 감싸는 형태로 만들어 주면 됩니다.

만약 `/blog/:id` 이런 형태로 id값을 받기 위해서는 blog 폴더 아래에 \[id].svelte라는 파일을 만들어 주면 됩니다. 그리고 파라미터 값이 여러 개일 경우에는 \[첫번째]\[두번째].svelte 이런식으로 만들어 주면 됩니다.

```
meteorAccount
├── .meteor
├── src
│   ├── pages
│   │    ├── blog
│   │    │   ├── [id].velte    => /about/1234
│   │    │   └── index.svelte  => /about
---------------------------------
```

그리고 이렇게 전달된 파일은 `params` 라는 helper를 사용해 받을 수 있습니다. 아래 예제를 기준으로 설명드리면, 위에서 id값을 넘겼기 대문에 `{$params.id}` 와 같이 id값이 params helper의 하위 객체처럼 받아서 사용할 수 있습니다.

```
<script>
import { params } from '@sveltech/routify'
</script>

<p>param : {$params.id}</p>
```

[\[만들면서 배우는 Svelte\]](https://www.inflearn.com/course/%EB%A7%8C%EB%93%A4%EB%A9%B4%EC%84%9C-%EB%B0%B0%EC%9A%B0%EB%8A%94-%EC%8A%A4%EB%B2%A8%ED%8A%B8)

<div align="left"><img src="/files/-MGqwZuQK1aEaE5Bp21i" alt="만들면서 배우는 svelte"></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://freeseamew.gitbook.io/svelte/8.-routify/parameter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
