/**
  * View
  *
  * @param array $options
  * @return array
  */
 public function view($options)
 {
     if (!$options['article_srl']) {
         return ['state' => 'error', 'message' => 'not found article_srl'];
     }
     // get article data
     $article = Spawn::item(['table' => Spawn::getTableName('article'), 'where' => 'srl=' . $options['article_srl']]);
     if (!$article) {
         return ['state' => 'error', 'message' => 'not found article data'];
     }
     $article['json'] = Util::jsonToArray($article['json'], null, true);
     $article['regdate'] = Util::convertDate($article['regdate']);
     $article['modate'] = Util::convertDate($article['modate']);
     // set content type
     switch ($options['contentType']) {
         case 'markdown':
             // load parsedown
             require_once __GOOSE_PWD__ . 'vendor/Parsedown/Parsedown.class.php';
             require_once __GOOSE_PWD__ . 'vendor/parsedown-extra/ParsedownExtra.php';
             // get instance parsedown
             $Parsedown = new ParsedownExtra();
             // convert markdown
             $article['content'] = '<div class="markdown-body">' . $Parsedown->text($article['content']) . '</div>';
             break;
         case 'text':
             $article['content'] = nl2br(htmlspecialchars($article['content']));
             break;
         default:
             break;
     }
     // set prev,next item
     $print_data = explode(',', $options['print_data']);
     $str = '';
     $str .= $this->searchKeyInArray($print_data, 'nest') ? 'nest_srl=' . (int) $article['nest_srl'] : '';
     $str .= $this->searchKeyInArray($print_data, 'category') && $article['category_srl'] ? ' and category_srl=' . (int) $article['category_srl'] : '';
     $str .= $str ? ' and ' : ' app_srl=' . $options['app_srl'] . ' and ';
     $prevItem = Spawn::item(['table' => Spawn::getTableName('article'), 'field' => 'srl', 'where' => $str . 'srl<' . (int) $article['srl'], 'order' => 'srl', 'sort' => 'desc', 'limit' => 1]);
     $nextItem = Spawn::item(['table' => Spawn::getTableName('article'), 'field' => 'srl', 'where' => $str . 'srl>' . (int) $article['srl'], 'order' => 'srl', 'limit' => 1]);
     // get nest data
     $nest = Spawn::item(['table' => Spawn::getTableName('nest'), 'field' => 'srl,name,id,json', 'where' => 'srl=' . (int) $article['nest_srl']]);
     $nest['json'] = Util::jsonToArray($nest['json'], null, true);
     // get category
     $category = $article['category_srl'] ? Spawn::item(['table' => Spawn::getTablename('category'), 'field' => 'name', 'where' => 'srl=' . (int) $article['category_srl']]) : null;
     return ['state' => 'success', 'article' => $article, 'nest' => $nest, 'category' => $category, 'prev_srl' => isset($prevItem['srl']) ? (int) $prevItem['srl'] : null, 'next_srl' => isset($nextItem['srl']) ? (int) $nextItem['srl'] : null, 'checkUpdateHit' => $options['updateHit'] ? $this->updateHit((int) $article['hit'], (int) $article['srl']) : null];
 }