当前位置: 首页>>代码示例>>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;未经允许,请勿转载。