@blog.justoneplanet.info

日々勉強

CakePHPでログインフォームを作る

<?php
if($this->Session->check('Message.auth')){
    echo $this->Session->flash();// error msg
    echo $this->Session->flash('auth');// error msg
}
echo $form->create(
    'Admin',
    array(
        'url' => array(
            'controller' => 'users',
            'action'     => 'login'
        )
    )
);
?>
<div data-role="fieldcontain">
<dl>
<dt><label for="name">ユーザ名</label></dt>
<dd><?php
echo $form->input(
    'name',
    array(
        'div'   => false,
        'label' => false,
        'id'    => 'name'
    )
);
?></dd>
</dl>
</div>
<div data-role="fieldcontain">
<dl>
<dt><label for="password">パスワード</label></dt>
<dd><?php
echo $form->input(
    'password',
    array(
        'div'   => false,
        'label' => false,
        'id'    => 'password',
        'value' => ''
    )
);
?></dd>
</dl>
<p><?php
echo $form->submit(
    'ログイン',
    array(
        'div'   => false,
        'label' => false,
    )
);
?></p>
<?php
echo $form->end();
?>

コメントはまだありません»

No comments yet.

RSS feed for comments on this post.TrackBack URL

Leave a comment