示例#1
0
 /**
  * @descrpition 添加
  */
 public function add()
 {
     if (Request::getRequest('dosubmit', 'str')) {
         $jumpUrl = '/admin.php/friendlink/add/';
         $fields = array();
         $fields['name'] = Request::getRequest('name', 'str');
         $fields['url'] = Request::getRequest('url', 'str');
         $fields['nofollow'] = Request::getRequest('nofollow', 'int');
         if (empty($fields['name'])) {
             View::showAdminErrorMessage($jumpUrl, '未填写完成');
         }
         $result = FriendLinkBusiness::setFriendLink($fields);
         if ($result) {
             View::showAdminMessage('/admin.php/friendlink/lists', '添加成功');
         } else {
             View::showAdminErrorMessage($jumpUrl, '添加失败');
         }
     }
     $friendLinkList = FriendLinkBusiness::getFriendLinkList();
     View::assign('friendLinkList', $friendLinkList);
     View::showAdminTpl('friend_link_add');
 }