# 템플릿 커스터마이징 방법

{% hint style="danger" %} <mark style="color:red;">**개발 가이드를 준수하지 않아 발생하는 모든 문제는 전적으로 이용자에게 책임이 있습니다!**</mark>
{% endhint %}

## 📌 고도몰의 템플릿 엔진 <a href="#undefined" id="undefined"></a>

* 고도몰은 2개의 템플릿 엔진으로 작동되도록 구현되어졌습니다.
* 템플릿 엔진의 종류

### `includeEngine`

* 관리자 페이지 전용
* 템플릿이 php 파일로 구성

### `template_`

* 프론트/모바일 페이지 전용
* `Template_` 엔진 사용
* 템플릿이 html 파일로 구성
* `safe mode`로 구성되어 일반적인 PHP 함수 사용 불가 (하단의 사용 가능 PHP함수 참고)

## 📌 `Template_` 플러그인 <a href="#template" id="template"></a>

| 플러그인                                                                             | 설명                                       |
| -------------------------------------------------------------------------------- | ---------------------------------------- |
| dataBank($bankCode)                                                              | 입금은행 배열, `all`로 하는 경우 전부다 반환             |
| dataBanner($bannerGroupCode, $eachFl = false)                                    | 배너리스트 배열 반환                              |
| dataBookmark($bookmarkBanner = null, $bookmarkUrl = null, $bookmarkTitle = null) | 즐겨찾기 데이터 배열 반환                           |
| dataCartGoodsCnt()                                                               | 장바구니에 담겨있는 수량 반환                         |
| dataCategoryPosition($cateCd, $arrow = null, $cateType = 'category')             | 카테고리의 현위치 출력                             |
| dataEggBanner($mode = 'banner')                                                  | 구매안전(에스크로)서비스 배너 및 설명 출력                 |
| dataGoodsMemberGroupPrice($getData, $groupSno)                                   | 회원그룹가 반환                                 |
| dataGoodsRelation($relation, $relationDate)                                      | 관련상품 데이터 배열 반환                           |
| dataGoodsReviewCnt($goodsNo)                                                     | 상품후기 데이터 배열 반환                           |
| dataHitKeyword()                                                                 | 설정된 인기검색어 반환                             |
| dataSubCategory($parentcategory, $cateType = 'category', $imageFl = 'n')         | 서브카테고리 리스트 반환                            |
| dataTodayGoods($rowNo)                                                           | 최근 본 상품 데이터 배열 반환                        |
| dataTodayGoodsCnt()                                                              | 최근 본 상품에 담긴 상품 수량을 반환                    |
| dataWishGoodsCnt()                                                               | 찜리스트 수량 반환                               |
| getArticles($bdId, $listCount, $strCut = null)                                   | 게시글 리스트 반환                               |
| includeFile($path, ...$args)                                                     | 템플릿안에서 파일을 include 처리                    |
| includeWidget($path, ...$args)                                                   | 템플릿안에서 Widget을 include 처리                |
| plusShop($path, ...$args)                                                        | 플러스샵 전용 템플릿                              |
| pollViewBanner($code = null)                                                     | 설문조사 배너 출력                               |
| setBrowserCache($filePath)                                                       | 파일의 변경 여부에 따라 브라우저 캐시가 작동되도록 리소스의 주소를 반환 |

## 📌 스킨에서 사용가능한 PHP 함수 <a href="#php" id="php"></a>

### PHP 기본 함수

#### string

```
addcslashes
addslashes
explode
implode
join
nl2br
number_format
sprintf
str_repeat
str_replace
strip_tags
stripcslashes
stripslashes
strtolower
strtoupper
strtr
strlen
strpos
substr
```

#### date, time

```
date
mktime
strtotime
time
```

#### regexp

```
preg_match
preg_replace
```

#### array

```
array_key_exists
array_keys
array_merge
array_pop
array_push
array_reverse
array_search
array_shift
array_slice
array_splice
array_sum
array_unique
array_unshift
array_values
array
arsort
asort
count
current
each
end
extract
in_array
key
key_exists
krsort
ksort
list
natcasesort
natsort
next
prev
range
reset
rsort
shuffle
sort
```

#### Math

```
ceil
floor
max
min
mt_rand
round
```

#### JSON

```
json_decode
json_encode
```

#### URL

```
rawurldecode
rawurlencode
urldecode
urlencode
```

#### Variable handling

```
empty
floatval
intval
is_array
is_int
is_null
is_numeric
is_object
is_string
isset
unset
```

### Godomall 내부 함수

```
gd_byte2str
gd_copy_protect
gd_currency_default
gd_currency_display
gd_currency_string
gd_currency_symbol
gd_date_format
gd_debug
gd_display_deposit
gd_display_group_label
gd_display_mileage_name
gd_display_mileage_unit
gd_get
gd_get_footer_logo_tag
gd_get_group_image_http_path
gd_get_login_name
gd_home_uri
gd_html_add_goods_image
gd_html_cut
gd_html_goods_image
gd_html_icon
gd_html_image
gd_htmlspecialchars
gd_htmlspecialchars_addslashes
gd_htmlspecialchars_decode
gd_htmlspecialchars_slashes
gd_htmlspecialchars_stripslashes
gd_is_html
gd_is_login
gd_is_plus_shop
gd_isset
gd_mb2byte
gd_mileage_display
gd_money_format
gd_number_figure
gd_remove_comma
gd_remove_tag
gd_select_box
gd_select_box_by_mail_domain
gd_session
gd_str_dfind
gd_str2js
gd_strtocamel
gd_trim
gd_url
gd_use_coupon
gd_use_coupon_offline
gd_use_deposit
gd_use_mileage
gd_youtube_player
```


---

# 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/source-code/template.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.
