本文整理汇总了PHP中Floxim\Floxim\System\Fx::lang方法的典型用法代码示例。如果您正苦于以下问题:PHP Fx::lang方法的具体用法?PHP Fx::lang怎么用?PHP Fx::lang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floxim\Floxim\System\Fx
的用法示例。
在下文中一共展示了Fx::lang方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAuthForm
public function getAuthForm()
{
//$form = new \Floxim\Form\Form(array('id' => 'auth_form'));
$form = fx::data('floxim.form.form')->create();
$form->addFields(array('email' => array('label' => 'E-mail', 'validators' => 'email -l'), 'password' => array('type' => 'password', 'label' => fx::lang('Password')), 'remember' => array('type' => 'checkbox', 'label' => fx::lang('Remember me')), 'submit' => array('type' => 'submit', 'label' => fx::lang('Log in'))));
return $form;
}
示例2: validate
public function validate()
{
$fields = $this->getComponent()->getAllFields();
foreach ($fields as $f) {
if ($f['is_required'] && !$this[$f['keyword']]) {
$this->invalid($f['name'] . ': ' . fx::lang('This field is required'), $f['keyword']);
}
}
return parent::validate();
}
示例3: doRecoverForm
public function doRecoverForm()
{
//$form = new \Floxim\Form\Form();
$form = fx::data('floxim.form.form')->generate();
$form->addFields(array('email' => array('label' => 'E-mail', 'validators' => 'email -l', 'value' => $this->getParam('email')), 'submit' => array('type' => 'submit', 'label' => fx::lang('Send me new password'))));
if ($form->isSent() && !$form->hasErrors()) {
$user = fx::data('floxim.user.user')->getByLogin($form->email);
if (!$user) {
$form->addError(fx::lang('User not found'), 'email');
} else {
$password = $user->generatePassword();
$user['password'] = $password;
$user->save();
fx::data('session')->where('user_id', $user['id'])->delete();
$mailer = fx::mail();
$res = $mailer->to($form->email)->data('floxim.user.user', $user)->data('password', $password)->data('site', fx::env('site'))->template('user.password_recover')->send();
if ($res) {
$form->addMessage('New password is sent to ' . $form->email);
}
}
}
return array('form' => $form);
}