resource 모듈의 일부 기능을 board 모듈로 이식하는 작업을 하는 중입니다. 

머리가 너무 안 돌아가네요. ;;

질문 드립니다.

 

resource 모듈에서 보면 아래와 같은 구문이 있습니다.

function procResourceInsertComment() {
    $oCommentController = &getController('comment');
    $oResourceModel = &getModel('resource');

    if(!$this->grant->write_comment) return new Object(-1, 'msg_not_permitted');
    if(!$this->module_srl) return new Object(-1,'msg_invalid_request');

    $args = Context::gets('package_srl', 'item_srl','star_point','content');
    $args->module_srl = $this->module_srl;

    if(!$args->star_point || !$args->content || !$args->package_srl || !$args->item_srl) return new Object(-1,'msg_invalid_request');

이 중에서,

$args = Context::gets('package_srl', 'item_srl','star_point','content');

Context:gets(...) 부분이 있는데 이게 board 모듈에서는,

$obj = Context::getRequestVars();

이런 식으로 처리되는 것 같습니다. 

그럼 getRequestVars()라는 건 어디에서 정의를 하는 건가요?

 

참조

http://xpressengine.github.io/xe-manual-api/html/classContext.html#a9ddbc79a7ba5892d1ea2d793f6ad52c2

http://web.geusgod.pe.kr:8081/xe/9585

  • profile
    POST값 아닌가요?
  • profile profile
    아, 따로 모듈 내에서 정의해줄 필요가 없군요. resource 모듈에서는 Context::gets(...) 라고 해주어서,
    꼭 정의해주어야 하는지 알았는데, 스킨 단에서 form 안에 있는 값들을 getRequestVars라고 해서 불러오는 거군요.
    감사합니다
  • profile profile
    만약 procBoardInsertComment 라는 function 에서
    $obj = Context::getRequestVars();
    라는 부분이 쓰여졌다면,
    스킨/_comment.html 에서 post되는 input 의 값들이 모두 다 getRequestVars()에 포함이 되는 거겠군요?
  • profile profile
    네. 저는 그렇게 알고 있습니다!^^