loop 문 안에서 $layout_info-> 변수값 가져오기
굉장히 오랜 시간 많은 삽질을 했지만 결국 성공했습니다. -_-)v
{@$i=0;} {@ $wdg[0] = $set->wdg_random0; $wdg[1] = $set->wdg_random1; $wdg[2] = $set->wdg_random2; $wdg[3] = $set->wdg_random3; }
먼저 루프문 앞에 반복될 변수를 배열로 만들어줍니다. 결국 이 방법이 기본이고 젤 간단한 거 같아요.
<li loop="$main_menu->list => $key1, $val1" class="depth1" cond="$val1['list']"> <a href="{$val1['href']}" class="on"|cond="$val1['selected']" target="_blank"|cond="$val1['open_window'] == 'Y'">{$val1['link']}</a> <div class="gnb_sub_wrap"> <dl class="gnb_sub" cond="$val1['list']"> <dt>{$val1['link']} <i class="xi-angle-right"></i></dt> <dd loop="$val1['list'] => $key2, $val2" class="depth2 <!--@if($val2['list'])-->more<!--@end-->"> <a href="{$val2['href']}" target="_blank"|cond="$val2['open_window'] == 'Y'">{$val2['link']}</a> </dd> </dl> <div class="wdg_random">{$wdg[$i]} </div> </div> {@$i++;} </li>
그리고 이렇게 loop 되는 메뉴 안에 변수를 배열 출력하도록 작성하고 끝냅니다. :)

eond
Lv. 12
댓글 3