當前位置: 首頁>>代碼示例>>PHP>>正文


PHP front::view2方法代碼示例

本文整理匯總了PHP中front::view2方法的典型用法代碼示例。如果您正苦於以下問題:PHP front::view2方法的具體用法?PHP front::view2怎麽用?PHP front::view2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在front的用法示例。


在下文中一共展示了front::view2方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: group_remove

 /**
  * 群刪日誌
  */
 public static final function group_remove()
 {
     // 獲取數據
     if (!isset($_POST['book_id']) || !is_array($_POST['book_id'])) {
         $error = '該日誌不存在';
         front::view2('error.tpl', compact('error'));
         return;
     }
     // 刪除數據
     self::deletes(null, null, array('book_id' => $_POST['book_id']), null, __CLASS__);
     header('Location: ?' . $_GET['query']);
 }
開發者ID:antsmallant,項目名稱:coreapp,代碼行數:15,代碼來源:book.php

示例2: tree

 public static final function tree()
 {
     $online = front::online();
     $channels = self::get_channel();
     $docs = self::selects('doc_id,typeid,title,create_date,create_time,update_date,update_time,hit', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,doc_id DESC'), array('doc_id', 'assoc|table=doc' => null));
     $sites = self::selects('site_id,typeid,title,create_date,create_time,update_date,update_time', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,site_id DESC'), array('site_id', 'assoc|table=site' => null));
     $adds = self::selects('address_id,typeid,name', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,address_id DESC'), array('address_id', 'assoc|table=address' => null));
     $diarys = self::selects('diary_id,typeid,title,create_date,create_time,update_date,update_time', null, array('user_id' => $online->user_id), array('ORDER BY typeid ASC,diary_id DESC'), array('diary_id', 'assoc|table=diary' => null));
     return front::view2(__CLASS__ . '.' . 'tree.tpl', compact('channels', 'docs', 'sites', 'adds', 'diarys'), null, false);
 }
開發者ID:antsmallant,項目名稱:coreapp,代碼行數:10,代碼來源:channel.php

示例3: group_remove

 /**
  * 群刪用戶
  */
 public static final function group_remove()
 {
     if (!self::user_level(2, __CLASS__, __FUNCTION__)) {
         return;
     }
     $online = front::online();
     // 獲取數據
     if (!isset($_POST['user_id']) || !is_array($_POST['user_id'])) {
         $error = '該用戶不存在';
         front::view2('common/error.tpl', compact('error'));
         return;
     }
     // 刪除數據
     self::deletes(null, null, array('user_id' => $_POST['user_id'], 'user_id!=?' => $online->user_id), null, __CLASS__);
     header('Location: ?' . $_GET['query']);
 }
開發者ID:antsmallant,項目名稱:coreapp,代碼行數:19,代碼來源:user.php

示例4: index

 /**
  * 默認動作
  */
 public static final function index()
 {
     front::view2(__CLASS__ . '.' . __FUNCTION__ . '.tpl');
 }
開發者ID:antsmallant,項目名稱:coreapp,代碼行數:7,代碼來源:sync.php

示例5: remove

 /**
  * 刪除網址
  */
 public static final function remove()
 {
     // 獲取數據
     $related = new self();
     $related->related_id = isset($_GET['related_id']) ? $_GET['related_id'] : null;
     if (!is_numeric($related->related_id) || !$related->select()) {
         $error = '該關聯不存在';
         front::view2('error.tpl', compact('error'));
         return;
     }
     // 刪除數據
     $related->delete();
     header('Location: ?' . $_GET['query']);
 }
開發者ID:antsmallant,項目名稱:coreapp,代碼行數:17,代碼來源:related.php

示例6: login


//.........這裏部分代碼省略.........
     // 表單處理
     while ($redirect === null && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] === 'POST' || $method == 'get' && $_SERVER['REQUEST_METHOD'] === 'GET')) {
         // 配置處理
         $attribute_array = array('front_class', 'front_table', 'front_fuzzy', 'front_username', 'front_password', 'front_redirect');
         list($front_class, $front_table, $front_fuzzy, $front_username, $front_password, $front_redirect) = self::init($attribute_array);
         list($front_class2, $front_table2, $front_fuzzy2, $front_username2, $front_password2, $front_redirect2) = parent::init($attribute_array);
         $front_class === '' and $front_class = $front_class2;
         $front_table === '' and $front_table = $front_table2;
         $front_fuzzy === '' and $front_fuzzy = $front_fuzzy2;
         $front_username === '' and $front_username = $front_username2;
         $front_password === '' and $front_password = $front_password2;
         $front_redirect === '' and $front_redirect = $front_redirect2;
         // 數據驗證
         if ($post['username'] === '') {
             $error['username'] = '用戶名不能為空';
         }
         if ($post['password'] === '') {
             $error['password'] = '密碼不能為空';
         }
         if (!IN_WAP) {
             if ($post['authcode'] === '') {
                 $error['authcode'] = '驗證碼不能為空';
             } elseif (!self::authcode($post['authcode'])) {
                 $error['authcode'] = '驗證碼輸入不正確';
             }
         }
         if ($error !== array()) {
             break;
         }
         // 密碼加密處理
         //$post ['password'] = md5 ($post ['password']);
         //$front_password = md5 ($front_password);
         if (empty($front_class)) {
             $front_class = get_parent_class();
         }
         if ($front_username) {
             // 配置項驗證
             if ($front_fuzzy) {
                 // 同時驗證
                 if ($front_username !== $post['username'] || $front_password !== md5($post['username'] . md5($post['password']))) {
                     $error['username'] = $error['password'] = '用戶名或密碼不正確';
                     break;
                 }
             } else {
                 // 分開驗證
                 if ($front_username !== $post['username']) {
                     $error['username'] = '用戶名不存在';
                     break;
                 }
                 if ($front_password !== md5($post['username'] . md5($post['password']))) {
                     $error['password'] = '密碼不正確';
                     break;
                 }
             }
             $online = new $front_class();
             $online->username = $post['username'];
             $online->password = md5($post['username'] . md5($post['password']));
         } else {
             // 數據庫驗證
             if (empty($front_table)) {
                 $front_table = null;
                 $class_table = 'class|table=' . $front_class;
             } else {
                 $class_table = 'class';
             }
             if ($front_fuzzy) {
                 // 同時驗證
                 $online = self::selects(null, $front_table, array('username' => $post['username'], 'password' => md5($post['username'] . md5($post['password']))), null, array($class_table => $front_class));
                 if (empty($online)) {
                     $error['username'] = $error['password'] = '用戶名或密碼不正確';
                     break;
                 }
             } else {
                 // 分開驗證
                 $online = self::selects(null, $front_table, array('username' => $post['username']), null, array($class_table => $front_class));
                 if (empty($online)) {
                     $error['username'] = '用戶名不存在';
                     break;
                 }
                 if ($online->password !== md5($post['username'] . md5($post['password']))) {
                     $error['password'] = '密碼不正確';
                     break;
                 }
             }
         }
         // 頁麵跳轉
         self::online($online);
         if ($post['redirect'] !== '') {
             header('Location: ' . $post['redirect']);
         } elseif ($front_redirect !== '') {
             header('Location: ' . $front_redirect);
         } else {
             echo 'Require front_redirect.';
         }
         return false;
     }
     // 顯示模板
     front::view2(__CLASS__ . '.' . __FUNCTION__ . '.tpl', compact('error', 'redirect', 'method'));
     return false;
 }
開發者ID:antsmallant,項目名稱:coreapp,代碼行數:101,代碼來源:front.php


注:本文中的front::view2方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。