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


PHP error::page方法代码示例

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


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

示例1: __call

 public function __call($name, $args)
 {
     $class_name = "helper\\{$name}";
     if (!class_exists($class_name)) {
         \error::page("helper {$name} not found");
     } else {
         return new $class_name($args);
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:9,代码来源:helper.php

示例2: config

 /**
  * [config description]
  * @return [type] [description]
  */
 final function config()
 {
     if (method_exists($this->validate, 'getFunctions') && $this->validate->getFunctions()) {
         foreach ($this->validate->getFunctions() as $key => $args) {
             if (empty($args)) {
                 $args = array();
             } elseif (!is_array($args)) {
                 $args = array($args);
             }
             if (!is_object($args[0])) {
                 error::page("validate inline extends {$key} not found");
             }
             $closure = \Closure::bind($args[0], $this);
             $onf = $this->status;
             $ret = call_user_func_array($closure, $args);
             if ($ret == false || $onf === true && $this->status == false) {
                 $this->setError($key);
             }
         }
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:25,代码来源:validator.php

示例3: loadController

 public function loadController($controller_name)
 {
     router::set_controller($controller_name);
     if (!class_exists($controller_name)) {
         error::page($controller_name);
     }
     $controller = new $controller_name();
     self::$controller = $controller;
     if (method_exists($controller, '_route')) {
         $controller->i_route();
     }
     if (router::get_controller() !== $controller_name) {
         $this->controller_finder();
         return;
     }
     if (method_exists($controller, 'config') || array_key_exists('config', $controller->Methods)) {
         $controller->iconfig();
     }
     if (method_exists($controller, 'options')) {
         $controller->ioptions();
     }
     if (count(router::get_url_property(-1)) > 0 && $controller->route_check_true === false) {
         error::page('Unavailable');
     }
     $controller->i_corridor();
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:26,代码来源:main.php

示例4: loadController

 public function loadController()
 {
     /**
      * find controller;
      */
     $url_property = router::get_url_property(-1);
     $myrep = router::get_repository_name();
     if (!router::get_controller()) {
         $controller_name = '\\' . $myrep . '\\' . router::get_class() . '\\' . router::get_method() . '\\controller';
         $prv_class = router::get_class();
         // var_dump($controller_name);
         if (!class_exists($controller_name)) {
             if ((!isset($url_property[1]) || $url_property[1] != router::get_method()) && router::get_method() != 'home') {
                 router::add_url_property(router::get_method());
             }
             $prv_method = router::get_method();
             router::set_method('home');
             $controller_name = '\\' . $myrep . '\\' . router::get_class() . '\\' . router::get_method() . '\\controller';
             // var_dump(router::get_url_property(-1));
             // var_dump($controller_name);
             if (!class_exists($controller_name)) {
                 router::set_class($prv_class);
                 $controller_name = '\\' . $myrep . '\\' . router::get_class() . '\\controller';
                 // var_dump(router::get_url_property(-1));
                 // var_dump($controller_name);
                 if (!class_exists($controller_name)) {
                     if ((!isset($url_property[0]) || $url_property[0] != router::get_class()) && router::get_class() != 'home') {
                         router::add_url_property(router::get_class());
                     }
                     router::set_class('home');
                     $controller_name = '\\' . $myrep . '\\' . router::get_class() . '\\' . router::get_method() . '\\controller';
                     // var_dump(router::get_url_property(-1));
                     // var_dump($controller_name);
                     //
                     if (!class_exists($controller_name)) {
                         router::set_class('home');
                         $controller_name = '\\' . $myrep . '\\' . router::get_class() . '\\controller';
                         // var_dump(router::get_url_property(-1));
                         // $controller_name='\account\home\controller';
                         // var_dump($controller_name);
                         if (!class_exists($controller_name)) {
                             \lib\error::page("content not found");
                         }
                     }
                 }
             }
         }
     } else {
         $controller_name = router::get_controller();
     }
     router::set_controller($controller_name);
     if (!class_exists($controller_name)) {
         error::page($controller_name);
     }
     $controller = new $controller_name();
     self::$controller = $controller;
     // running template base module for homepage
     if (\lib\router::get_storage('CMS') && $myrep == 'content' && method_exists($controller, 's_template_finder')) {
         $controller->s_template_finder();
     }
     if (method_exists($controller, '_route')) {
         $controller->_route();
     }
     if (router::get_controller() !== $controller_name) {
         $this->loadController();
         return;
     }
     if (method_exists($controller, 'config')) {
         $controller->config();
     }
     if (method_exists($controller, 'options')) {
         $controller->options();
     }
     if (count(router::get_url_property(-1)) > 0 && $controller->route_check_true === false) {
         error::page('Unavailable');
     }
     $controller->_corridor();
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:78,代码来源:main.php

示例5: make

 /**
  * [make description]
  * @param  boolean $name [description]
  * @param  boolean $args [description]
  * @return [type]        [description]
  */
 function make($name = false, $args = false)
 {
     if (is_object($name)) {
         $this->{$args} = $name;
     } elseif (preg_match("/^\\.(.*)\$/", $name, $fname)) {
         $class = '\\cls\\form\\' . $fname[1];
         $args = func_get_args();
         if (class_exists($class)) {
             return new $class(...array_splice($args, 1));
         } else {
             $class = '\\addons\\includes' . $class;
             if (class_exists($class)) {
                 return new $class(...array_splice($args, 1));
             } else {
                 error::page("form {$class} not exist");
             }
         }
     } elseif (preg_match("/^\\#(.*)\$/", $name, $fname)) {
         $class = '\\cls\\form\\symbol';
         if (class_exists($class)) {
             $form = self::$formExtends ? self::$formExtends : new $class();
         } else {
             $class = '\\addons\\includes' . $class;
             if (class_exists($class)) {
                 $form = self::$formExtends ? self::$formExtends : new $class();
             } else {
                 error::page("form {$class} not exist");
             }
         }
         if (isset($form->{$fname[1]})) {
             return $form->{$fname[1]};
             return null;
         } else {
             error::page("form extend {$fname['1']}");
         }
     } elseif (preg_match("/^\\@([^\\.]*)\\.(.*)\$/", $name, $fname)) {
         $s_function = "get" . ucfirst($fname[1]);
         $table = \lib\sql\table::$s_function($fname[2]);
         if ($table) {
             $form = new $this();
             foreach ($table as $key => $value) {
                 if (isset($value->closure) && isset($value->closure->form)) {
                     $form->make($value->closure->form, $key);
                 }
             }
             // var_dump($form);
             $form->add('submit', 'submit')->value(T_('submit'))->class('button primary row-clear');
             $args = func_get_args();
             if (isset($args[2])) {
                 $form->submit->value($args[2]);
             }
             // if(isset($args->submit))
             // 	$form->submit->value($args->submit);
             return $form;
         }
         return null;
     } elseif ($name) {
         $element = new \lib\form\maker($name);
         return $element;
     } else {
         return new $this();
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:69,代码来源:form.php


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