영카트 관련 질문입니다 $this가 가리키는 객체를 찾을수 없네요 ㅠㅠ
본문
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
add_javascript('<script src="'.G5_THEME_JS_URL.'/jquery.shop.list.js"></script>', 10);
?>
<div class="con_right">
<!-- 상품진열 10 시작 { -->
<?php
for ($i=1; $row=sql_fetch_array($result); $i++) {
if ($this->list_mod >= 2) { // 1줄 이미지 : 2개 이상
if ($i%$this->list_mod == 0) $sct_last = 'sct_last'; // 줄 마지막
else if ($i%$this->list_mod == 1) $sct_last = 'sct_clear'; // 줄 첫번째
else $sct_last = '';
} else { // 1줄 이미지 : 1개
$sct_last = 'sct_clear';
}
if ($i == 1) {
if ($this->css) {
echo "<ul class=\"{$this->css}\">\n";
} else {
echo "<ul class=\"sct sct_10 sct_list_10\">\n";
}
}
테마폴더안에 스킨폴더안에 있는 list.10.skin.php 파일의 앞부분 코드인데요..
여기 등장한 $this가 현재 객체를 가리키는게 맞죠? 근데 이 파일에는 클래스도 객체도 없고 include된 파일도 없는데 이 $this가 가리키는 객체는 어디서 찾나요??ㅠㅠ
답변 3
여기 스킨 말고 위에 보면 클래스로 가져오는거 있잖아요? 그거를 사용하셨나요?
$list = new item_list(); 이런거요
다른 파일이 스킨파일을 include 합니다.
https://github.com/gnuboard/gnuboard5/blob/master/shop/list.php#L101
>
https://github.com/gnuboard/gnuboard5/blob/master/shop/list.php#L125
>
https://github.com/gnuboard/gnuboard5/blob/master/shop/list.php#L140
>
https://github.com/gnuboard/gnuboard5/blob/master/lib/shop.lib.php#L341
list.php에서 내용을 만들고 스킨은 출력만 담당합니다
답변을 작성하시기 전에 로그인 해주세요.