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


PHP Lang::_getInstance方法代码示例

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


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

示例1: add

 /**
  * @param string $key
  * @param string $code
  * @param array $details
  * @return $this
  */
 public function add($key, $code, $details = array())
 {
     $error = $this->errors[] = Lang::_getInstance()->getError($key, $code, $details);
     switch ($this->_('verbosity')) {
         case 'die':
             die($error);
         case 'echo':
             echo $error;
         default:
     }
     return $this;
 }
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:18,代码来源:Error.php

示例2: autoload

 private function autoload()
 {
     foreach (Config::_getInstance()->getValue('helper', 'Loader') as $helper) {
         include_once HELPER_PATH . "{$helper}.php";
     }
     foreach (Config::_getInstance()->getValue('lang', 'Loader') as $lang) {
         Lang::_getInstance()->load($lang);
     }
     foreach (Config::_getInstance()->getValue('config', 'Loader') as $config) {
         Config::_getInstance()->load($config);
     }
 }
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:12,代码来源:Loader.php

示例3: restorePassword

 /**
  * @param string $content
  * @return $this
  */
 public function restorePassword($content = null)
 {
     $t = Token::_getInstance();
     if (!is_null($content)) {
         $t->_get(array('Content' => $content, 'Type' => 'restorePassword'))->_eq()->__($this->_('token', false));
         if ($this->countErrors() || is_null($this->_('token'))) {
             return $this->addError('password restoration', 0);
         }
         $this->_get($this->_('token')['UserID']);
         if (!input('json')) {
             return $this;
         }
         if ($this->_upsert(array('Email' => $this->_result['Email'], 'Password' => PasswordHash::_getInstance()->create_hash(input('password')), 'FirstName' => $this->_result['FirstName'], 'LastName' => $this->_result['LastName'], 'RoleID' => $this->_result['RoleID']))->countErrors()) {
             return $this;
         }
         $t->_drop();
         return $this->result(Lang::_getInstance()->getValue('passwordReset', 'User'));
     }
     if (!input('json')) {
         return $this->result(array());
     }
     $email = input('email');
     if ($this->_get(array('Email' => $email, 'Active' => true))->_eq()->countErrors() || empty($this->_result)) {
         return $this->addError('password restoration', 1);
     }
     $t->_upsert(array('Content' => $t->_generate(), 'Type' => 'restorePassword', 'UserID' => $this->_result['ID']))->__($this->_('token', false));
     Email::_getInstance()->send($email, 'restorePassword', array('token' => $this->_('token')['Content']));
     if ($this->countErrors()) {
         $t->_drop();
         return $this;
     }
     return $this->result(Lang::_getInstance()->getValue('passwordRestorationSent', 'User'));
 }
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:37,代码来源:User.php

示例4: restorePassword

 /**
  * @param array $data
  * @return $this
  */
 private function restorePassword($data = array())
 {
     $this->subject = Lang::_getInstance()->getValue('passwordRestorationSubject', 'User');
     $this->message = Lang::_getInstance()->getValue('passwordRestorationBody', 'User', array($data['token']));
     return $this;
 }
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:10,代码来源:Email.php

示例5: __init

 protected function __init()
 {
     Lang::_getInstance()->load($this->_('type', get_class($this)));
     return $this;
 }
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:5,代码来源:Common.php

示例6: lang

/**
 * @param string $key
 * @param string|array $type
 * @param array $args
 */
function lang($key, $type = null, $args = array())
{
    echo Lang::_getInstance()->getValue($key, $type, $args);
}
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:9,代码来源:Lang.php


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