本文整理汇总了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;
}
示例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);
}
}
示例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'));
}
示例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;
}
示例5: __init
protected function __init()
{
Lang::_getInstance()->load($this->_('type', get_class($this)));
return $this;
}
示例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);
}