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


PHP View::error方法代码示例

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


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

示例1: backupInit

 public function backupInit($config)
 {
     F('_backup_', '[del]');
     //创建目录
     if (!is_dir($config['dir']) && !mkdir($config['dir'], 0755, true)) {
         View::error('目录创建失败', $config['url']);
     }
     $table = Db::getAllTableInfo();
     $table = $table['table'];
     foreach ($table as $d) {
         //limit起始数
         $table[$d['tablename']]['first'] = 0;
         //文件编号
         $table[$d['tablename']]['fileId'] = 1;
     }
     $cache['table'] = $table;
     $cache['config'] = $config;
     //备份表结构
     $tables = Db::getAllTableInfo();
     $sql = "<?php if(!defined('HDPHP_PATH'))EXIT;\n";
     foreach ($tables['table'] as $table => $data) {
         $createSql = Db::select("SHOW CREATE TABLE {$table}");
         $sql .= "Db::execute(\"DROP TABLE IF EXISTS {$table}\");\n";
         $sql .= "Db::execute(\"{$createSql[0]['Create Table']}\");\n";
     }
     if (file_put_contents($config['dir'] . '/structure.php', $sql)) {
         file_put_contents($config['dir'] . '/config.php', "<?php return " . var_export($config, true) . ";");
         F('_backup_', $cache);
         return true;
     } else {
         F('_backup_' . '[del]');
         $this->error = '表结构备份失败';
         return false;
     }
 }
开发者ID:arnold1119,项目名称:cms,代码行数:35,代码来源:Backup.php

示例2: forgotpwd

 /**
  * Forgot password
  */
 private function forgotpwd()
 {
     if (isset($_POST['forgotpwd'])) {
         $email = $_POST['email'];
         if (!Validate::len($email)) {
             $error = 'Email character count must be between 4 and 64';
         } elseif (!Validate::email($email)) {
             $error = 'Please enter a valid email';
         }
         if (!$error) {
             $user = User::where('email', $email)->select('id')->findOne();
             if (!$user) {
                 $error = 'Email address not found';
             }
         }
         if ($error) {
             View::error('user/forgotpwd', $error);
         }
         // Makes an internal session
         $pwd = Session::set('pwd', $user->id, 0);
         View::set('session_pwd', $pwd);
         Base::sendMail($email, 'forgotpwd');
         Base::redirect('', 'Go to your email and follow the instructions');
     } elseif (isset($_GET['pwd'])) {
     }
 }
开发者ID:nytr0gen,项目名称:plur-music-explorer,代码行数:29,代码来源:user.php

示例3: login

 /**
  * [login 登录]
  * @return [type] [description]
  */
 public function login()
 {
     if (IS_POST) {
         if (strtoupper(I('post.code')) != strtoupper(myRedis::get('code'))) {
             View::error('验证码错误!', 'http://' . __HOST__ . '/admin/login/');
             die;
         }
         $userName = I('post.username');
         $password = I('post.password');
         $pwd = md5('ISirweb' . $password);
         $userData = Admin::where(['who' => $userName, 'mypwd' => $pwd])->get()->toArray();
         if (empty($userData)) {
             View::error('用户名或密码错误!', 'http://' . __HOST__ . '/admin/login/');
             die;
         }
         //如果未修改php.ini下面两行注释去掉
         // ini_set('session.save_handler', 'redis');
         // ini_set('session.save_path', 'tcp://127.0.0.1:6379');
         session_start();
         $_SESSION['uid'] = $userData[0]['id'];
         $_SESSION['name'] = $userData[0]['who'];
         $_SESSION['email'] = $userData[0]['email'];
         View::success('登录成功', 'http://' . __HOST__ . '/admin/');
         die;
     }
     $this->smarty->assign('title', '登录_ISisWeb中文网_ISirPHPFramework');
     $this->smarty->display('Admin/Login/login.html');
     die;
 }
开发者ID:joymi,项目名称:ISirPHPFramework,代码行数:33,代码来源:LoginContoller.php

示例4: edit

 public function edit()
 {
     if (IS_POST) {
         if ($this->db->edit()) {
             View::success('操作成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     } else {
         //商品分类
         $cate = new \Admin\Model\ShopCate();
         $cateData = $cate->getAll();
         View::with('cateData', $cateData);
         //商品品牌
         $brand = new \Admin\Model\ShopBrand();
         $brandData = $brand->getAll();
         View::with('brandData', $brandData);
         //获取图集信息
         $pics = new \Admin\Model\Pics();
         $picsData = $pics->getAll();
         View::with('picsData', $picsData);
         //商品类型列表
         $type = new \Admin\Model\ShopType();
         $typeData = $type->getAll();
         View::with('typeData', $typeData);
         //商品属性列表
         $attr = new \Admin\Model\GoodsAttr();
         $attrData = $attr->getAll(Q('goods_id'));
         View::with('attrData', $attrData);
         //读取商品信息
         $field = $this->db->getOne();
         View::with('field', $field)->make();
     }
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:34,代码来源:GoodsController.php

示例5: init

 /**
  * Starting point for every page request. Loads required core modules, gets data from url and calls
  * necessary modules to make things happen.
  */
 public static function init()
 {
     if (!self::$_inited) {
         self::$_inited = true;
         foreach (self::$_requiredCore as $module) {
             require_once ROOT . 'core/' . $module . '/' . $module . EXT;
         }
         // Set the Load::auto method to handle all class loading from now on
         spl_autoload_register('Load::auto');
         Load::loadSetupFiles();
         // If CLI mode, everything thats needed has been loaded
         if (IS_CLI) {
             return;
         }
         date_default_timezone_set(Config::get('system.timezone'));
         Event::trigger('caffeine.started');
         // If maintenance mode has been set in the config, stop everything and load mainteance view
         if (Config::get('system.maintenance_mode')) {
             View::error(ERROR_MAINTENANCE);
         } else {
             list($route, $data) = Router::getRouteData();
             if ($data) {
                 if (self::_hasPermission($route, $data)) {
                     list($module, $controller, $method) = $data['callback'];
                     $params = Router::getParams();
                     // Make sure controller words are upper-case
                     $conBits = explode('_', $controller);
                     foreach ($conBits as &$bit) {
                         $bit = ucfirst($bit);
                     }
                     $controller = implode('_', $conBits);
                     $controller = sprintf('%s_%sController', ucfirst($module), ucwords($controller));
                     // Call the routes controller and method
                     if (method_exists($controller, $method)) {
                         $response = call_user_func_array(array($controller, $method), $params);
                         if (!self::_isErrorResponse($response)) {
                             Event::trigger('module.response', array($response));
                             View::load($module, $controller, $method);
                         } else {
                             View::error($response);
                         }
                     } else {
                         Log::error($module, sprintf('The method %s::%s() called by route %s doesn\'t exist.', $controller, $method, $route));
                         View::error(ERROR_500);
                     }
                 } else {
                     View::error(ERROR_ACCESSDENIED);
                 }
             } else {
                 if ($route !== '[index]' || !View::directLoad('index')) {
                     View::error(ERROR_404);
                 }
             }
         }
         View::output();
         Event::trigger('caffeine.finished');
     } else {
         die('Why are you trying to re-initialize Caffeine?');
     }
 }
开发者ID:simudream,项目名称:caffeine,代码行数:64,代码来源:index.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     session_start();
     if (!isset($_SESSION['uid'])) {
         View::error('请登录。。。', 'http://' . __HOST__ . '/admin/login/');
         die;
     }
 }
开发者ID:joymi,项目名称:ISirPHPFramework,代码行数:9,代码来源:CommonController.php

示例7: initialize

 /**
  * Callback que se ejecuta antes de los métodos de todos los controladores
  */
 protected final function initialize()
 {
     /**
      * Si el método de entrada es ajax, el tipo de respuesta es sólo la vista
      */
     if (Input::isAjax()) {
         View::template(null);
     }
     /**
      * Verifico que haya iniciado sesión
      */
     if (!MkcAuth::isLogged()) {
         //Verifico que no genere una redirección infinita
         if ($this->controller_name != 'login' && ($this->action_name != 'entrar' && $this->action_name != 'salir')) {
             MkcMessage::warning('No has iniciado sesión o ha caducado.');
             //Verifico que no sea una ventana emergente
             if ($this->module_name == 'reporte') {
                 View::error();
                 //TODO: crear el método error()
             } else {
                 MkcRedirect::toLogin('sistema/login/entrar/');
             }
             return false;
         }
     } else {
         if (MkcAuth::isLogged() && $this->controller_name != 'login') {
             $acl = new MkcAcl();
             //Cargo los permisos y templates
             if (APP_UPDATE && Session::get('perfil_id') != Perfil::SUPER_USUARIO) {
                 //Solo el super usuario puede hacer todo
                 if ($this->module_name != 'dashboard' && $this->controller_name != 'index') {
                     $msj = 'Estamos en labores de actualización y mantenimiento.';
                     $msj .= '<br />';
                     $msj .= 'El servicio se reanudará dentro de ' . APP_UPDATE_TIME;
                     if (Input::isAjax()) {
                         View::update();
                     } else {
                         MkcMessage::info($msj);
                         MkcRedirect::to("dashboard");
                     }
                     return FALSE;
                 }
             }
             if (!$acl->check(Session::get('perfil_id'))) {
                 MkcMessage::error('Tu no posees privilegios para acceder a <b>' . Router::get('route') . '</b>');
                 Input::isAjax() ? View::ajax() : View::select(NULL);
                 return false;
             }
             if (!defined('SKIN')) {
                 define('SKIN', Session::get('tema'));
             }
         }
     }
 }
开发者ID:slrondon,项目名称:WispCenter,代码行数:57,代码来源:backend_controller.php

示例8: edit

 public function edit()
 {
     if (IS_POST) {
         if ($this->db->edit()) {
             View::success('操作成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     } else {
         $field = $this->db->getOne();
         View::with('field', $field)->make();
     }
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:13,代码来源:ShopAttrController.php

示例9: listar

 /**
  * Método para listar las autitorías del sistema
  * @param type $fecha
  * @return type
  */
 public function listar($fecha = '', $formato = 'html')
 {
     $fecha = empty($fecha) ? date("Y-m-d") : Filter::get($fecha, 'date');
     if (empty($fecha)) {
         DwMessage::info('Selecciona la fecha del archivo');
         return View::error();
     }
     $audits = Sistema::getAudit($fecha);
     $this->audits = $audits;
     $this->fecha = $fecha;
     $this->page_module = 'Auditorías del sistema ' . $fecha;
     $this->page_format = $formato;
 }
开发者ID:slrondon,项目名称:MikrotikCenter,代码行数:18,代码来源:auditoria_controller.php

示例10: add

 public function add()
 {
     if (IS_POST) {
         // p($_POST);exit;
         if ($this->db->store()) {
             View::success('发表成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     } else {
         $cat = $this->category->getAll();
         View::with('cat', $cat)->make();
     }
 }
开发者ID:arnold1119,项目名称:cms,代码行数:14,代码来源:ArticleController.php

示例11: isValidKey

 /**
  * Método para verificar si la llave es válida
  * 
  * @param string $id
  * @param string $action
  * @param string $filter Filtro a aplicar al id devuelto
  * @return boolean
  */
 public static function isValidKey($valueKey, $action = '', $filter = '', $popup = FALSE)
 {
     $key = explode('.', $valueKey);
     $id = $key[0];
     $validKey = self::getKey($id, $action);
     $valid = $validKey === $valueKey ? TRUE : FALSE;
     if (!$valid) {
         DwMessage::error('Acceso denegado. La llave de seguridad es incorrecta.');
         if ($popup) {
             View::error();
         }
         return FALSE;
     }
     return $filter ? Filter::get($id, $filter) : $id;
 }
开发者ID:slrondon,项目名称:MikrotikCenter,代码行数:23,代码来源:dw_security.php

示例12: edit

 public function edit()
 {
     if (IS_POST) {
         if ($this->db->edit()) {
             View::success('操作成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     } else {
         //分配品牌分类
         $cate = new \Admin\Model\ShopCate();
         $cateData = $cate->getAll();
         $field = $this->db->getOne();
         View::with('field', $field)->with('cateData', $cateData)->make();
     }
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:16,代码来源:ShopBrandController.php

示例13: edit

 public function edit()
 {
     if (IS_POST) {
         p($_POST['thumb']);
         if ($this->db->update()) {
             View::success('修改成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     }
     $id = Q('id', 0, 'intval');
     $data = $this->db->where('id', $id)->first();
     p($data);
     $data2 = new \Sadmin2\Model\Category();
     $data2 = $data2->getAll();
     View::with('data', $data)->with('data2', $data2)->make();
 }
开发者ID:arnold1119,项目名称:cms,代码行数:17,代码来源:ArticleController.php

示例14: edit

 public function edit()
 {
     if (IS_POST) {
         if ($this->db->edit()) {
             View::success('操作成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     } else {
         //搜索页规格分类
         $type = new \Admin\Model\ShopType();
         $typeData = $type->getAll();
         View::with('typeData', $typeData);
         $data = $this->db->getAll();
         $field = $this->db->getOne();
         View::with('data', $data)->with('field', $field)->make();
     }
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:18,代码来源:ShopCateController.php

示例15: edit

 public function edit()
 {
     if (IS_POST) {
         if ($this->db->update()) {
             View::success('修改成功', 'index');
         } else {
             View::error($this->db->getError());
         }
     } else {
         //读取栏目数据
         $category = new \Admin\Model\Category();
         $cat = $category->getAll();
         //原文章的数据
         $field = Db::table('article')->where('id', $_GET['id'])->first();
         View::with('cat', $cat)->with('field', $field);
         View::make();
     }
 }
开发者ID:arnold1119,项目名称:cms,代码行数:18,代码来源:ArticleController.php


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