In 1.2 the new syntax for the model/form fields is Model.field

<?php if ($error): ?;><p>Login denied. Please try again.</p><?php endif; ?>

<?php echo $form->create('Member', array('type' => 'post', 'action' =>
'login'));
echo $form->input('Member.email');
echo $form->input('Member.password');
echo $form->end('Login'); ?>

Also if you are looking for a way to reduce lines...

<?php echo $form->create('Member', array('type' => 'post', 'action' =>
'login')),
$form->inputs(array('email', 'password')),
$form->end('Login'); ?>

On Sat, Jul 19, 2008 at 2:47 PM, Parris <[EMAIL PROTECTED]> wrote:
>
> Wow thanks for the help. Yea the cake book was down (it just came back
> up) for 1.2.
>
> This is what I came up with for a login form:
>
> <?php
> if ($error):
> echo "<p>Login denied. Please try again.</p>";
> endif;
> echo $form->create('Member',array('type' => 'post', 'action' =>
> 'login'));
> echo $form->input('Member/email');
> echo $form->input('Member/password');
> echo $form->end('Login');
> ?>
>
> 7 lines of code for a login form? I could make a pun about how easy
> this is right now.
>
> On Jul 19, 10:32 am, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>> use input to generate labels with inputs (AFAIK if the name is password the
>> type is automajically set to password)
>> <?php echo $form->input('password', array('class' => 'required', 'tabindex'
>> => '4')); ?>
>>
>> $form->text, $form->password, $form->textarea are used when you don't want
>> the label to be generated
>>
>> // a confirm password can be made setting the type in the options array
>> <?php echo $form->input('confirm_password', array('type' => 'password',
>> 'class' => 'required', 'tabindex' => '5')); ?>
>>
>> also you can use $form->create('Member', Array('class' => 'hfrom', 'url' =>
>> '/members/login'))  then you can just pass 'email' & 'password' to the
>> inputs
>>
>> more info 
>> athttp://book.cakephp.org/view/182/formhttp://api.cakephp.org/class_form_helper.htmlhttp://www.donutczar.com/cake1point2/donuts/form_helper
>>
>> 2008/7/19 Parris <[EMAIL PROTECTED]>:
>>
>>
>>
>> > <?php if ($error): ?>
>> > <p>Login Credentials do not match. Please try again.</p>
>> > <?php endif; ?>
>>
>> > <form action="<?php echo $html->url('/members/login'); ?>"
>> > method="post" style="width:250px;">
>> >        <div>
>> >        <?php echo $form->input('Member/email'); ?>
>> >        </div>
>> >        <div>
>> >        <?php echo $form->password('Member/password'); ?>
>> >    </div>
>> >        <div>
>> >            <?php echo $form->submit('Login'); ?>
>> >        </div>
>> > </form>
>>
>> > A label gets output for input, but not for password. Also some style
>> > problems exist. This is with firefox 3, and I have cakePHP 1.2.0.7296
>> > RC2
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to