'spac controller dispatcher'에 해당되는 글 1건

  1. 2010.01.01 dispatcher
dispatcher 메소드는 사용자의 모델클래스 내에서 호출하며, 호출 즉시 모델클래스내에서 지정된 뷰 파일을 출력하는 역할을 합니다.

dispather 에 의해 페이지가 출력될경우 브라우저의 주소가 변경되지 않고 원하는 뷰의 내용을 출력할 수 있습니다.

사용법은 아래와 같이 뷰파일을 지정한 후 dispather 를 호출합니다.

dispacher 의 예제
class BBS extends Controller() {

    function BBS() {   }

    function goWriteForm() {
         $this->result_uri = 'write.html';
         $this->dispatcher();
    }

    function execute() {
        $this->goWriteForm();
    }

}


위의 내용 중 뷰를 지정하는 result_uri 값은 Spac 의 뷰 디렉토리를 기준으로 경로를 입력합니다.
$this->result_uri = 'write.html';            <== 이경우 "Spac/view/write.html" 의 경로에 파일이 있는경우


Posted by webdata