本文整理汇总了PHP中getInstance函数的典型用法代码示例。如果您正苦于以下问题:PHP getInstance函数的具体用法?PHP getInstance怎么用?PHP getInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getInstance函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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'));
}
示例3: __construct
public function __construct($vars = null)
{
if (isset($vars)) {
$this->init($vars, __CLASS__);
}
$this->localizacion = getInstance('Localizacion');
}
示例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;
}
示例5: init
/**
* Init
*/
public function init()
{
parent::init();
$cogear = getInstance();
Form::$types['file'] = 'Upload_Ajax_Form_File';
Form::$types['image'] = 'Upload_Ajax_Form_Image';
}
示例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);
}
示例7: render
public function render()
{
$cogear = getInstance();
$template = new Template('Benchmark.results');
$template->data = Benchmark_Gear::humanize($cogear->benchmark->measurePoint('system'));
return $template->render();
}
示例8: getPdo
public function getPdo()
{
if (!isset(self::$instance)) {
getInstance();
}
return $this->pdo;
}
示例9: __construct
/**
* 构造函数
*/
public function __construct()
{
$this->view = getInstance('Init\\View');
if (method_exists($this, '_initialize')) {
$this->_initialize();
}
}
示例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;
}
示例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'));
}
示例12: __construct
public function __construct()
{
$CI = getInstance();
if (!isset($CI->hotelavail)) {
throw new SiteminderErrors('Processing exception', '12');
}
$this->hotelavail_model = $CI->hotelavail;
unset($CI);
}
示例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);
}
示例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;
}
示例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;
}