• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getInstance函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getInstance函数的典型用法代码示例。如果您正苦于以下问题:PHP getInstance函数的具体用法?PHP getInstance怎么用?PHP getInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get

 public function get($usuario)
 {
     //$this->load->model('permisos/permisos_model');
     $this->usuario = getInstance("Usuario");
     //
     try {
         $condicion = "";
         if (isset($usuario['id_usuario'])) {
             $condicion = " u.id_usuario = " . (int) $usuario['id_usuario'];
         } elseif (isset($usuario['email'])) {
             $condicion = " u.email = " . $this->db->escape($usuario['email']);
         } else {
             //return NULL;
         }
         $query = $this->db->query("SELECT u.*,r.key as 'rol_key',r.descripcion as 'rol_descripcion',r.id_rol FROM usuarios u INNER JOIN roles r USING (id_rol) WHERE " . $condicion);
         unset($usuario);
         $usuario = $query->row_array();
         $this->usuario->init($usuario);
         if (!isset($usuario)) {
             return NULL;
         }
         return $this->usuario;
     } catch (Exception $e) {
         return null;
     }
 }
开发者ID:jpasosa,项目名称:global,代码行数:26,代码来源:Usuarios_model.php


示例2: _404

 public function _404()
 {
     $this->request();
     $cogear = getInstance();
     $cogear->response->header('Status', '404 ' . Response::$codes[404]);
     error(t('Page you are looking for was not found on the server.'), t('Page not found'));
 }
开发者ID:romartyn,项目名称:cogear,代码行数:7,代码来源:Gear.php


示例3: __construct

 public function __construct($vars = null)
 {
     if (isset($vars)) {
         $this->init($vars, __CLASS__);
     }
     $this->localizacion = getInstance('Localizacion');
 }
开发者ID:jpasosa,项目名称:global,代码行数:7,代码来源:person_abstract.php


示例4: link

 /**
  * Построение ссылки
  *
  * @param	string	$url
  * @param	boolean	$absolute_flag
  * @param	string	$protocol
  * @return	string
  */
 public static function link($url = '', $absolute_flag = FALSE, $protocol = 'http')
 {
     $link = '';
     $cogear = getInstance();
     if (!$url) {
         return $protocol . '://' . SITE_URL . '/';
     } else {
         if (TRUE === $url) {
             return l() . cogear()->router->getUri();
         }
     }
     $url = parse_url($url);
     if ($absolute_flag) {
         $link .= $protocol . '://';
         $link .= SITE_URL;
     } elseif (defined('FOLDER')) {
         $link .= '/' . FOLDER;
     }
     isset($url['host']) && ($link = $protocol . '://' . $url['host']);
     isset($url['path']) && ($link .= '/' . ltrim($url['path'], '/'));
     isset($url['query']) && ($link .= '?' . $url['query']);
     isset($url['fragment']) && ($link .= '#' . $url['fragment']);
     event('link', $link);
     if (cogear()->input->get('splash') === '') {
         $link .= e();
     }
     return $link;
 }
开发者ID:brussens,项目名称:cogear2,代码行数:36,代码来源:Url.php


示例5: init

 /**
  * Init
  */
 public function init()
 {
     parent::init();
     $cogear = getInstance();
     Form::$types['file'] = 'Upload_Ajax_Form_File';
     Form::$types['image'] = 'Upload_Ajax_Form_Image';
 }
开发者ID:romartyn,项目名称:cogear,代码行数:10,代码来源:Gear.php


示例6: __contsruct

 /**
  * Constructor
  */
 public function __contsruct()
 {
     parent::__construct();
     $cogear = getInstance();
     $this->mcrypt_cipher = $cogear->get('secure.mcrypt_cipher', MCRYPT_BLOWFISH);
     $this->mcrypt_mode = $cogear->get('secure.mcrypt_mode', MCRYPT_MODE_ECB);
 }
开发者ID:romartyn,项目名称:cogear,代码行数:10,代码来源:Gear.php


示例7: render

 public function render()
 {
     $cogear = getInstance();
     $template = new Template('Benchmark.results');
     $template->data = Benchmark_Gear::humanize($cogear->benchmark->measurePoint('system'));
     return $template->render();
 }
开发者ID:romartyn,项目名称:cogear,代码行数:7,代码来源:Widget.php


示例8: getPdo

 public function getPdo()
 {
     if (!isset(self::$instance)) {
         getInstance();
     }
     return $this->pdo;
 }
开发者ID:HelleboidQ,项目名称:test,代码行数:7,代码来源:BD.php


示例9: __construct

 /**
  * 构造函数
  */
 public function __construct()
 {
     $this->view = getInstance('Init\\View');
     if (method_exists($this, '_initialize')) {
         $this->_initialize();
     }
 }
开发者ID:wanezu,项目名称:PHPAPI,代码行数:10,代码来源:Controller.class.php


示例10: __call

 /**
  * Magic __call method
  * 
  * @param   string  $name
  * @param   array   $array
  */
 public function __call($name, $args = array())
 {
     $cogear = getInstance();
     if (method_exists($cogear, $name)) {
         return call_user_func_array(array($cogear, $name), $args);
     }
     return NULL;
 }
开发者ID:romartyn,项目名称:cogear,代码行数:14,代码来源:Cogearable.php


示例11: init

 /**
  * Init
  */
 public function init()
 {
     parent::init();
     $cogear = getInstance();
     $this->api = new Loginza_API();
     hook('form.user-login.result.before', array($this, 'hookUserForm'));
     hook('form.user-register.result.before', array($this, 'hookUserForm'));
     hook('form.user-profile.init', array($this, 'hookUserProfile'));
 }
开发者ID:romartyn,项目名称:cogear,代码行数:12,代码来源:Gear.php


示例12: __construct

 public function __construct()
 {
     $CI = getInstance();
     if (!isset($CI->hotelavail)) {
         throw new SiteminderErrors('Processing exception', '12');
     }
     $this->hotelavail_model = $CI->hotelavail;
     unset($CI);
 }
开发者ID:gkawin,项目名称:siteminder,代码行数:9,代码来源:hotelrate_amount_notif_model.php


示例13: getInstance

 public function getInstance()
 {
     $arguments = func_get_args();
     if (is_callable($this->staticObject)) {
         return call_user_func_array($this->staticObject, $arguments);
     }
     $class = $this->staticObject;
     return \getInstance($class, $arguments);
 }
开发者ID:quallsbenson,项目名称:utility-object,代码行数:9,代码来源:ObjectWrapper.php


示例14: getdatas

function getdatas($id)
{
    $pdo = getInstance();
    $query = $pdo->prepare("SELECT * FROM joueur JOIN classement ON classement.idJoueur = joueur.id WHERE id = :id");
    $query->bindValue(":id", $id);
    $query->execute();
    $datas = $query->fetch();
    return $datas;
}
开发者ID:maxfouquet,项目名称:Framework-dut-2,代码行数:9,代码来源:index.php


示例15: render

 /**
  * Render theme
  */
 public function render()
 {
     if ($this->is_rendered) {
         return;
     }
     $cogear = getInstance();
     $this->template = new Template($this->theme . '.' . $this->layout);
     $cogear->response->append($this->template->render());
     $this->is_rendered = TRUE;
 }
开发者ID:romartyn,项目名称:cogear,代码行数:13,代码来源:Object.php


示例16: finalPoint

 /**
  * Add final point and show calculations for system benchmark
  */
 public function finalPoint()
 {
     $this->addPoint('system.end');
     if (access('development')) {
         $cogear = getInstance();
         $template = new Template('Dev.results');
         $template->data = Dev_Gear::humanize($cogear->dev->measurePoint('system'));
         append('footer', $template->render());
         js($this->folder . '/js/inline/debug.js');
     }
 }
开发者ID:romartyn,项目名称:cogear,代码行数:14,代码来源:Gear.php


示例17: factory

 /**
  * Factory
  *
  * @param string $name
  * @param array $options
  */
 public static function factory($name, $data = NULL)
 {
     $cogear = getInstance();
     if (class_exists($name)) {
         $widget = new $name($data);
         if ($widget instanceof self) {
             return $widget;
         } else {
             unset($widget);
         }
     }
 }
开发者ID:romartyn,项目名称:cogear,代码行数:18,代码来源:Widget.php


示例18: result

 /**
  * Process elements value from request
  *
  * @return
  */
 public function result()
 {
     $cogear = getInstance();
     $file = new Upload_File($this->name, $this->getAttributes(), $this->validators->findByValue('Required'));
     if ($value = $file->upload()) {
         $this->is_fetched = TRUE;
         $this->value = $value;
     } else {
         $this->errors = $file->errors;
     }
     return $this->value;
 }
开发者ID:romartyn,项目名称:cogear,代码行数:17,代码来源:File.php


示例19: setPlugin

 private function setPlugin()
 {
     if (isset($this->match['params']['Plugin']) && isset($this->match['params']['app_type'])) {
         $app_type = ucfirst($this->match['params']['app_type']);
         $Plugin = $this->removeSlash(ucfirst($this->match['params']['Plugin']));
         $this->plugin = $app_type . '\\' . $Plugin;
         $plugin_view = BASE_PATH . 'lib/' . $app_type . '/' . $Plugin . '/View/';
         getInstance('Hu\\Core\\View\\View')->prependPath($plugin_view, $Plugin);
         $_ENV['page']['plugin_base_url'] = $_ENV['page']['base_url'] . 'lib/' . $app_type . '/' . $Plugin . '/';
         $_ENV['page']['plugin_assets_url'] = $_ENV['page']['plugin_base_url'] . 'Assets/';
     }
     return $this;
 }
开发者ID:Arunkumarcs,项目名称:Themis-Reinitialize,代码行数:13,代码来源:Values.php


示例20: urltesting

 public function urltesting()
 {
     $urlconfig = $GLOBALS['url'];
     foreach ($urlconfig as $key => $value) {
         foreach ($value as $k => $v) {
             if ($this->url == $k) {
                 $arr = explode("/", $v);
                 $d = getInstance(APP_NAME . '\\Controller\\' . $arr[0] . 'Controller');
                 $d->{$arr}[1]();
             }
         }
     }
 }
开发者ID:wanezu,项目名称:PHPAPI,代码行数:13,代码来源:Url.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getInstancia函数代码示例发布时间:2022-05-15
下一篇:
PHP getInstallType函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap