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


PHP Router::redirect方法代碼示例

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


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

示例1: run

 public function run()
 {
     $iID = $this->post('id');
     $iAccountID = $this->post('account_id');
     (new m\Account())->del($iID);
     c\Router::redirect(c\Router::genURL('Detail', ['id' => $iAccountID]));
 }
開發者ID:sdgdsffdsfff,項目名稱:open-sesame,代碼行數:7,代碼來源:DeleteField.php

示例2: run

 public function run()
 {
     $iAccountID = $this->get('id');
     $oAccount = new m\Account();
     $aDetail = $oAccount->getAccountDetail($iAccountID);
     if (empty($aDetail)) {
         c\Router::redirect(c\Router::genURL('Home'));
     }
     $aFields = $oAccount->getAccountFields($iAccountID);
     $oUser = new m\User();
     $aDefaultPassword = $oUser->getDefaultPassword();
     $aEmails = $oUser->getEmails();
     foreach ($aFields as $k => $v) {
         $aFields[$k]['display'] = u\Str::partCover($v['value'], 2, 1);
     }
     sort($aFields);
     $aFieldNames = array_map(function ($v) {
         foreach ($v as $key => $value) {
             if ($key !== 'name') {
                 unset($v[$key]);
             }
         }
         return $v;
     }, $aFields);
     $aAccountAll = $oAccount->getAllAccount();
     $aSiteList = [];
     foreach ($aAccountAll as $aAccountDetail) {
         $aSiteList[] = ['name' => 'link:' . $aAccountDetail['name']];
     }
     $aData = ['page_title' => 'Open Sesame - ' . $aDetail['name'], 'app' => $aDetail, 'fields' => $aFields, 'form_action_add' => c\Router::genURL('AddField'), 'form_action_del' => c\Router::genURL('DeleteField'), 'form_action_updatefield' => c\Router::genURL('UpdateField'), 'form_action_updateaccount' => c\Router::genURL('UpdateAccount'), 'site_list' => json_encode($aSiteList), 'field_names' => json_encode($aFieldNames), 'default_password' => $aDefaultPassword['data'], 'emails' => $aEmails['data']];
     return $aData;
 }
開發者ID:sdgdsffdsfff,項目名稱:open-sesame,代碼行數:32,代碼來源:Detail.php

示例3: run

 public function run()
 {
     $sFieldName = $this->post('field_name');
     $sFieldValue = $this->post('field_value');
     $iAccountID = $this->post('account_id');
     (new m\Account())->addField($sFieldName, $sFieldValue, $iAccountID);
     c\Router::redirect(c\Router::genURL('Detail', ['id' => $iAccountID]));
 }
開發者ID:sdgdsffdsfff,項目名稱:open-sesame,代碼行數:8,代碼來源:AddField.php

示例4: run

 public function run()
 {
     $sAccountName = $this->post('account_name');
     $sAccountURL = 'http://' . parse_url($this->post('account_url'))['host'];
     $iAccountID = $this->post('account_id');
     (new m\Account())->updateAccount($sAccountName, parse_url($sAccountURL)['host'], $iAccountID, false);
     c\Router::redirect(c\Router::genURL('Detail', ['id' => $iAccountID]));
 }
開發者ID:sdgdsffdsfff,項目名稱:open-sesame,代碼行數:8,代碼來源:UpdateAccount.php

示例5: run

 public function run()
 {
     $sName = $this->post('name');
     $sURL = $this->post('url');
     $aURLDetail = parse_url($sURL);
     $iAccountID = (new m\Account())->addAccount($sName, $aURLDetail['host']);
     c\Router::redirect(c\Router::genURL('Detail', ['id' => $iAccountID]));
 }
開發者ID:sdgdsffdsfff,項目名稱:open-sesame,代碼行數:8,代碼來源:AddAccount.php

示例6: run

 public function run()
 {
     $iID = $this->post('id');
     (new m\Account())->del($iID);
     c\Router::redirect(c\Router::genURL('Home'));
 }
開發者ID:sdgdsffdsfff,項目名稱:open-sesame,代碼行數:6,代碼來源:DeleteAccount.php


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