Hello,
I want to display login form in footer for every page if user is not logged.
Thanks,
<div class="footer">
<?php if (Yii::app()->user->isGuest): ?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'login-form',
'enableClientValidation'=>false,
'action'=>Yii::app()->controller->createAbsoluteUrl('/site/login')
/*'clientOptions'=>array(
'validateOnSubmit'=>true,
),*/
));
$loginForm = new LoginForm;
?>
<p class="note"><?php echo Yii::t('common', 'Fields with <span class="required">*</span> are required.'); ?></p>
<div class="row">
<?php echo $form->labelEx($loginForm,'username'); ?>
<?php echo $form->textField($loginForm,'username'); ?>
<?php echo $form->error($loginForm,'username'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($loginForm,'password'); ?>
<?php echo $form->passwordField($loginForm,'password'); ?>
<?php echo $form->error($loginForm,'password'); ?>
</div>
<div class="row rememberMe">
<?php echo $form->checkBox($loginForm,'rememberMe'); ?>
<?php echo $form->label($loginForm,'rememberMe'); ?>
<?php echo $form->error($loginForm,'rememberMe'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton(Yii::t('common', 'Login')); ?>
</div>
<?php $this->endWidget(); ?>
</div>
<?php endif; ?>
Return to Questions and help for changes
Users browsing this forum: No registered users and 50 guests