How to create a login page with registration?

1

I'm creating a web application in cakephp and I'm in doubt as I can not create the registration button on the login page.

My code is in \View\Users\login.ctp :

<div class="container">
    <div class="login-content">
        <?php echo $this->Html->image('logo1.png', array('alt' => 'fivassist Logo')); ?>

        <?php echo $this->Form->create('User'); ?>
        <div class="login-form">
            <h2>Bem-vindo!</h2>
            <ul>
                <li>
                    <label>E-mail:</label>
                    <?php echo $this->Form->input('email', 
                        array('label' => false, 'autocomplete' => 'off')); ?>
                </li>
                <li><label>Password:</label>
                    <?php echo $this->Form->input('password', 
                        array('label' => false, 'autocomplete' => 'off')); ?>
                </li>
            </ul>
        </div> <!-- end login-form -->
        <?php echo $this->Session->flash(); ?>
        <?php echo $this->Form->submit('Login', array('id' => 'login-bt')); ?>
        <a href="#" id="forgot">Esqueceu-se da sua password?</a>

            <a href="">Regista-te</a>

    </div> <!-- end login-content -->
</div> <!-- end container -->

I've tried this way and I can not seem to give add.ctp of user .

    
asked by anonymous 17.06.2014 / 16:59

1 answer

1

Change this line:

<?php echo $this->Form->submit('Login', array('id' => 'login-bt')); ?>

To:

<?php echo $this->Form->end('Login', array('id' => 'login-bt')); ?>
The end method creates the submit button with the properties defined in the array, and adds the </form> tag at the end.

And here too:

    <label>E-mail:</label>
    <?php echo $this->Form->input('email', 
                array('label' => false, 'autocomplete' => 'off')); ?>

You can simply do this:

 <?php echo $this->Form->input('email', 
                array('label' => 'E-mail:', 'autocomplete' => 'off')); ?>
    
26.06.2014 / 14:11