확장변수에 include 하고자 하는 파일을 입력받고

 

<include target="{$document->getExtraValue(1)}" />

 

이런식으로 출력하려고 하는데

 

Template not found: modules/document/tpl{$extravar_list[1]->getValueHTML()} 

 

이런 식으로 {$document->getExtraValue(1)} 그대로 출력해버리네요

 

방법이 없을까요?

 

 

  • profile

    다른 사람이 입력한 값을 include에 직접 사용하면 해킹당하는 지름길이므로 지원하지 않습니다.

     

    if문을 사용하여 각각 다른 파일을 불러오도록 구현하세요.

     

    <!--@if(확장변수 == 1)-->

        <include target="1.html" />

    <!--@elseif(확장변수 == 2)-->

        <include target="2.html" />

    <!--@else-->

        <include target="3.html" />

    <!--@end-->

  • profile profile
    그렇군요 계속 삽질할 뻔했네요 답변 감사드립니다.