Skip to content

Instantly share code, notes, and snippets.

@flyskyko
Last active August 29, 2015 14:01
Show Gist options
  • Save flyskyko/e9a8b0d121eaac6da226 to your computer and use it in GitHub Desktop.
Save flyskyko/e9a8b0d121eaac6da226 to your computer and use it in GitHub Desktop.
<?php
class myboardController extends myboard
{
public function procMyboardWrite()
{
// 권한 체크
if (!$this->grant->write_document)
{
return new Object(-1, 'msg_not_permitted');
}
// 데이터 준비
$args = new stdClass();
$args->module_srl = $this->module_srl;
$args->nick_name = Context::get('nick_name');
$args->title = Context::get('title');
$args->content = Context::get('content');
// document 모듈에 등록
$oDocumentController = getController('document');
$output = $oDocumentController->insertDocument($args);
// 결과 체크
if (!$output->toBool())
{
return $output;
}
// 성공 시 글 보기 화면으로 이동
$returnUrl = getNotEncodedUrl('', 'mid', $this->mid, 'document_srl', $output->get('document_srl'));
$this->setRedirectUrl($returnUrl);
}
}
/* End of file: myboard.controller.php */
Copy link

ghost commented May 17, 2014

파일 경로 : XE-ROOT/modules/myboard/myboard.controller.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment