当前位置: 首页>>代码示例>>PHP>>正文


PHP registry::remove方法代码示例

本文整理汇总了PHP中registry::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP registry::remove方法的具体用法?PHP registry::remove怎么用?PHP registry::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在registry的用法示例。


在下文中一共展示了registry::remove方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 public function add()
 {
     if (isset($_POST['save_user_btn'])) {
         $row = [];
         if ($_GET['id']) {
             $row['id'] = $_GET['id'];
         } else {
             $row['create_date'] = date('Y-m-d H:i:s');
         }
         $row['email'] = $_POST['email'];
         $row['user_name'] = $_POST['user_name'];
         $row['user_surname'] = $_POST['user_surname'];
         $row['user_group_id'] = $_POST['user_group_id'];
         if ($_POST['user_password']) {
             $row['user_password'] = md5($_POST['user_password']);
         }
         $this->model('backend_users')->insert($row);
         if ($_POST['user_password']) {
             $this->logOut();
             $this->auth(registry::get('user')['email'], md5($_POST['user_password']));
             registry::remove('user');
             $this->checkAuth();
         }
         header('Location: ' . SITE_DIR . 'users/');
         exit;
     }
     $this->render('user_groups', $this->model('user_groups')->getAll());
     if ($_GET['id']) {
         $this->render('user', $this->model('backend_users')->getById($_GET['id']));
     }
     $this->view('users' . DS . 'add');
 }
开发者ID:novichkovv,项目名称:tvoydom,代码行数:32,代码来源:users_controller.php

示例2: setConfig

 /**
  * @param $key
  * @param $value
  */
 protected function setConfig($key, $value)
 {
     $row = $this->model('asanatt_system_config')->getByField('config_key', $key);
     $row['config_key'] = $key;
     $row['config_value'] = $value;
     $this->model('asanatt_system_config')->insert($row);
     $config = registry::get('config');
     $config[$key] = $value;
     registry::remove('config');
     registry::set('config', $config);
 }
开发者ID:novichkovv,项目名称:dashboard,代码行数:15,代码来源:base.php

示例3: getConfig

 /**
  * @param string $key
  * @return string
  */
 protected function getConfig($key)
 {
     if (!$key) {
         return false;
     }
     if (!($value = registry::get('config')[$key])) {
         $config = registry::get('config');
         $config[$key] = $this->model('system_config')->getByField('config_key', $key)['config_value'];
         registry::remove('config');
         registry::set('config', $key);
         return $config[$key];
     } else {
         return $value;
     }
 }
开发者ID:novichkovv,项目名称:bartender,代码行数:19,代码来源:base.php

示例4: model

 /**
  * @param string $model
  * @param null/string $table
  * @param null/string $db
  * @param null/string $user
  * @param null/string $password
  * @return model
  */
 protected function model($model, $table = null, $db = null, $user = null, $password = null)
 {
     $models = registry::get('models');
     if (!($m = $models[$model][$table])) {
         $model_file = ROOT_DIR . 'models' . DS . $model . '_model.php';
         if (file_exists($model_file)) {
             $model_class = $model . '_model';
             $m = new $model_class($table ? $table : $model, $db, $user, $password);
         } else {
             $m = new default_model($model);
         }
         $models[$model][$table] = $m;
         registry::remove('models');
         registry::set('models', $models);
     }
     return $m;
 }
开发者ID:novichkovv,项目名称:newddetox,代码行数:25,代码来源:base.php

示例5: index_ajax

 public function index_ajax()
 {
     switch ($_REQUEST['action']) {
         case "save_password":
             if ($_POST['password'] && $_POST['password'] == $_POST['repeat_password']) {
                 $row = array('id' => registry::get('user')['id'], 'user_password' => md5($_POST['password']));
                 if ($this->model('asanatt_users')->insert($row)) {
                     echo json_encode(array('status' => 1));
                     $this->logOut();
                     $this->auth(registry::get('user')['email'], md5($_POST['password']));
                     registry::remove('user');
                     $this->checkAuth();
                 } else {
                     echo json_encode(array('status' => 2));
                 }
             }
             exit;
             break;
     }
 }
开发者ID:novichkovv,项目名称:tvoydom,代码行数:20,代码来源:settings_controller.php

示例6: log

 /**
  * @param mixed $value
  */
 protected function log($value)
 {
     $log = registry::get('log');
     registry::remove('log');
     $log[] = print_r($value, 1);
     registry::set('log', $log);
 }
开发者ID:novichkovv,项目名称:bartender,代码行数:10,代码来源:model.php


注:本文中的registry::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。