本文整理汇总了PHP中FormUI::input_name方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::input_name方法的具体用法?PHP FormUI::input_name怎么用?PHP FormUI::input_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormUI
的用法示例。
在下文中一共展示了FormUI::input_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login_form
/**
* Display the login form
*
* @param string $name Pre-fill the name field with this name
*/
protected function login_form()
{
// Build theme and login page template
$this->setup_theme();
if (!$this->theme->template_exists('login')) {
$this->theme = Themes::create('admin', 'RawPHPEngine', Site::get_dir('admin_theme', true));
$this->theme->assign('admin_page', 'login');
}
// Build the login form
$form = new FormUI('habari_login');
//$form->on_success( array( $this, 'loginform_success' ) );
$login_form_title = _t('<h1><a href="%1$s" title="%2$s"><img alt="%2$s" src="%3$s" style="height:1em;margin-right:10px;vertical-align:top;">%4$s</a></h1>', array(Site::get_url('site'), _t('Go to Site'), Site::get_url('habari', '/system/admin/images/habari.logo.png'), Options::get('title')));
$form->append(FormControlStatic::create('title')->set_static($login_form_title));
$form->append(FormControlStatic::create('reset_message')->set_static('<p id="reset_message" class="on_reset">' . _t('Please enter the username you wish to reset the password for. A unique password reset link will be emailed to that user.') . '</p>'));
$form->append(FormControlLabel::wrap(_t('Name'), FormControlText::create('habari_username')->set_property('autofocus', 'autofocus'))->set_template('control.label.outsideleft'));
$form->append(FormControlLabel::wrap(_t('Password'), FormControlPassword::create('habari_password', null, array('class' => 'off_reset')))->set_template('control.label.outsideleft')->set_properties(array('class' => 'off_reset')));
$form->append($drop_button = FormControlDropbutton::create('submit_button')->add_template_class('ul', 'off_reset'));
$drop_button->append(FormControlSubmit::create('login')->on_success(array($this, 'loginform_do_login'))->set_caption(_t('Login')));
$form->append(FormControlStatic::create('reset_link')->set_static('<a href="#" class="off_reset reset_link">' . _t('Reset password') . '</a>'));
$form->append(FormControlStatic::create('login_link')->set_static('<a href="#" class="on_reset reset_link">' . _t('Login') . '</a>'));
$form->append(FormControlSubmit::create('reset_button')->set_caption(_t('Reset password'))->set_properties(array('class' => 'on_reset'))->on_success(array($this, 'loginform_do_reset')));
// Use the dropbutton's visualizer to select the primary action for form submission upon pressing enter
$form->set_settings(array('prefix_html' => '<script>$(function(){$("body").on("keypress", "form[name=' . $form->input_name() . ']", function(e){if(e.which==13){$(this).find("#' . $form->submit_button->get_visualizer() . ' .primary").click();return e.preventDefault()&&false;}});})</script>'));
// Let plugins alter this form
Plugins::act('form_login', $form);
// Assign login form and display the page
$this->theme->form = $form;
$this->display('login');
return true;
}