g4['path'] 추가하는 방법이 궁금합니다. 정보
g4['path'] 추가하는 방법이 궁금합니다.본문
$g4['bbs'] = "bbs";
$g4['bbs_path'] = $g4['path'] . "/" . $g4['bbs'];
$g4['bbs_img'] = "img";
$g4['bbs_img_path'] = $g4['path'] . "/" . $g4['bbs'] . "/" . $g4['bbs_img'];
$g4['admin'] = "_cnadmin";
$g4['admin_path'] = $g4['path'] . "/" . $g4['admin'];
$g4['editor'] = "cheditor";
$g4['editor_path'] = $g4['path'] . "/" . $g4['editor'];
$g4['cheditor4'] = "cheditor4";
$g4['cheditor4_path'] = $g4['path'] . "/" . $g4['cheditor4'];
$g4['geditor'] = "geditor";
$g4['geditor_path'] = $g4['path'] . "/" . $g4['geditor'];
---------------------------------------------------------------
위와 같이 있는 곳에서 경로를 하나 더 추가하고 싶어서
$g4['111'] = "111";
$g4['111_path'] = $g4['path'] . "/" . $g4['111'];
이렇게 수정하고 111폴더 안에서 경로를 <?=$g4['111']?> 이렇게 줬더니 111/111 이런식으로 폴더가 두번 나오네요 ;;
이거 왜 이럴까요?
$g4['bbs_path'] = $g4['path'] . "/" . $g4['bbs'];
$g4['bbs_img'] = "img";
$g4['bbs_img_path'] = $g4['path'] . "/" . $g4['bbs'] . "/" . $g4['bbs_img'];
$g4['admin'] = "_cnadmin";
$g4['admin_path'] = $g4['path'] . "/" . $g4['admin'];
$g4['editor'] = "cheditor";
$g4['editor_path'] = $g4['path'] . "/" . $g4['editor'];
$g4['cheditor4'] = "cheditor4";
$g4['cheditor4_path'] = $g4['path'] . "/" . $g4['cheditor4'];
$g4['geditor'] = "geditor";
$g4['geditor_path'] = $g4['path'] . "/" . $g4['geditor'];
---------------------------------------------------------------
위와 같이 있는 곳에서 경로를 하나 더 추가하고 싶어서
$g4['111'] = "111";
$g4['111_path'] = $g4['path'] . "/" . $g4['111'];
이렇게 수정하고 111폴더 안에서 경로를 <?=$g4['111']?> 이렇게 줬더니 111/111 이런식으로 폴더가 두번 나오네요 ;;
이거 왜 이럴까요?
댓글 전체
head.sub.php 에
$111 = "$g4[path]/111"; //이렇게 주고
$111_img = "$g4[path]/111_img";
사용은 아래처럼 해 보세요..
<?=$111?>/어쩌구..
<?=$111_img?>/ooo.gif
$111 = "$g4[path]/111"; //이렇게 주고
$111_img = "$g4[path]/111_img";
사용은 아래처럼 해 보세요..
<?=$111?>/어쩌구..
<?=$111_img?>/ooo.gif
현재 경로가 111/ 상태에서 <?=$g4['111']?> 선언하면 당연히 111/111 로 될것입니다.
$g4['111_path'] 를 호출하시면 111/ 디렉토리안이라 하더라도 111/ 로 호출될것입니다.
위의 $g4['path'] 가 상대경로마다 변경되거든요..
(더자세히는 $g4_path 가변경되고 common.php를 따로 불러오는것 이지만)
해당 디렉토리를 임의 생성했다면 다른 디렉토리내의 _common.php 파일의 내용을 확인해보셔요
$g4['111_path'] 를 호출하시면 111/ 디렉토리안이라 하더라도 111/ 로 호출될것입니다.
위의 $g4['path'] 가 상대경로마다 변경되거든요..
(더자세히는 $g4_path 가변경되고 common.php를 따로 불러오는것 이지만)
해당 디렉토리를 임의 생성했다면 다른 디렉토리내의 _common.php 파일의 내용을 확인해보셔요