> For the complete documentation index, see [llms.txt](https://devcenter-help.nhn-commerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devcenter-help.nhn-commerce.com/other-guide/include.md).

# include 사용 가이드

> 파일 경로를 직접 include 하지 않고
>
> 연관된 Controller를 통해 include 대상을 전달하는 방식으로 구현한다.

#### 적용 목적

* 스킨과 비즈니스 로직 분리
* 경로 변경 시, 스킨 수정 최소화
* 보안 및 유지보수성 확보
* 관리자 스킨 구조 일관성 유지

### ⚠️ 잘못된 사용 예시

```
<?php
include "/goods/goods_register.php";
?>

```

### ✅ 권장 사용 방식

* include 대상은 Controller에서 정의
* 스킨에서는 전달받은 변수만 사용

#### 관리자 스킨

```
<?php
...
include($testPage);
?>
```

#### Controller

```
<?php
...
$this->getView()->setDefine('testPage', '{연결하고자 하는 파일 경로}');
?>
```

#### 예시

```
<?php
...
$this->getView()->setDefine(
    'testPage',
    $this->getPath() . '/goods/goods_register.php'
);
?>
```
