# 사용자 페이지 추가하기

## 📌 요구사항 및 분석

* 새로운 사용자 샘플 페이지를 추가하고자 함

## 📝 개선안 정리

* <https://gdadmin.example.godomall.com/test/sample.php>
  * 위 URL에 대한 스킨 파일 추가
  * 위 URL로 잡근 가능한 컨트롤러 추가

## 🛠️ 커스터마이징 진행

### 📌 Controller 추가 <a href="#controller-1" id="controller-1"></a>

1. `module/Controller` 폴더 하위에 `Front/Test` 폴더를 생성합니다.

{% hint style="info" %}
`module`폴더 이후의 폴더명은 `Upper Camel Case`로 작성합니다.
{% endhint %}

2. 생성한 `Test` 폴더 하위에 `SampleController.php` 파일을 생성하여 원하는 기능을 추가합니다.

{% code title="SampleController.php" %}

```php
<?php

/**
 * Namespace는 Controller\폴더명\폴더명으로 작성합니다.
 */
namespace Controller\Front\Test;

/**
 * Classname는 파일명과 동일해야 합니다.
 * \Controller\Front\Controller라는 부모 클래스를 상속받습니다.
 */
class SampleController extends \Controller\Front\Controller
{
    /**
     * Class Methods로 반드시 index()를 포함해야 합니다.
     * 추가로 Methods 만들어 동일 파일내에서 사용이 가능합니다.
     */
    public function index()
    {
        $setData = 'Hello World !!!';
        $this->setData('setData', $setData);
    }
}

// PHP 소스 코드만 포함된 경우 ?> 를 생략합니다. (PSR0 표준)
```

{% endcode %}

### 📌 스킨 파일 추가 <a href="#controller-1" id="controller-1"></a>

* `data/skin/front/[스킨]/test` 폴더를 생성합니다.
* 생성한 `test` 폴더 하위에 `sample.html` 파일을 추가한 다음, `Controller`에서 전달한 `setData`를 출력합니다.

{% code title="sample.html" %}

```html
<table border="1">
    <tr>
        <td>{=setData}</td>
    </tr>
</table>
```

{% endcode %}

## 🔖 결과 확인

<figure><img src="/files/fzA7lRtNNUDCr6YmMNmj" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://devcenter-help.nhn-commerce.com/guide/tuning-example/add-user-page.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
