IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

Integration de bootstrap dans cakephp 2 [CakePHP]


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Février 2008
    Messages
    154
    Détails du profil
    Informations personnelles :
    Localisation : Côte d'Ivoire

    Informations forums :
    Inscription : Février 2008
    Messages : 154
    Points : 58
    Points
    58
    Par défaut Integration de bootstrap dans cakephp 2
    bonsoir à tous,
    je voudrais integrer le modele bootstrap sign in dans cakephp pour faire l'authentification.

    auparavant j'avais fait mon propre formulaire et j'arrive à me logger avec.

    avec bootstrap,je sais vraiment pas comment l'adapter pour pouvoir me logger.

    help please.

    mon formulaire login.ctp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    <div class="users form">
    <?php echo $this->Session->flash('auth'); ?>
    <?php echo $this->Form->create('User');?>
        <fieldset>
            <legend><?php echo __('Merci de rentrer votre nom d\'user et mot de passe'); ?></legend>
            <?php 
    			echo $this->Form->input('username');
    			echo $this->Form->input('password');
    		?>
        </fieldset>
    <?php echo $this->Form->end(__('Connexion'));?>
    </div>
    le formulaire de bootstrap signin.ctp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
     
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <!--<link rel="shortcut icon" href="../../assets/ico/favicon.png">-->
     
        <title>Signin Template for Bootstrap</title>
     
        <!-- Bootstrap core CSS -->
        <!--<link href="../../dist/css/bootstrap.css" rel="stylesheet">-->
    	<?php
    		//echo $html->css('bootstrap');
    		//echo $html->css('signin');
    		//echo $this->Html->css('signin');
    		//echo $this->Html->css('bootstrap');
    		echo $this->Html->meta('icon');
     
    		echo $this->Html->css(
    			array(
    					//'bootstrap.min',
    					'bootstrap' ,
    					'docs',
    					'font-awesome',
    					'style',
    					'cake.generic',
    					'signin'
                    )
                );
     
     
    			echo $this->Html->script(
                    array(
                        'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
                        'bootstrap.min',
                    ),
                    array('block' => 'scriptBottom')
                ); 
    	?>
     
        <!-- Custom styles for this template -->
        <!--<link href="signin.css" rel="stylesheet">-->
     
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="../../assets/js/html5shiv.js"></script>
          <script src="../../assets/js/respond.min.js"></script>
        <![endif]-->
      </head>
     
      <body>
     
        <div class="container">
     
          <form class="form-signin">
            <h2 class="form-signin-heading">Please sign in</h2>
            <input type="text" class="form-control" placeholder="Email address" autofocus>
            <input type="password" class="form-control" placeholder="Password">
            <label class="checkbox">
              <input type="checkbox" value="remember-me"> Remember me
            </label>
            <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
          </form>
     
        </div> <!-- /container -->
     
     
        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
      </body>
    </html>
    signin.css
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
     
    body {
      padding-top: 40px;
      padding-bottom: 40px;
      background-color: #eee;
    }
     
    .form-signin {
      max-width: 330px;
      padding: 15px;
      margin: 0 auto;
    }
    .form-signin .form-signin-heading,
    .form-signin .checkbox {
      margin-bottom: 10px;
    }
    .form-signin .checkbox {
      font-weight: normal;
    }
    .form-signin .form-control {
      position: relative;
      font-size: 16px;
      height: auto;
      padding: 10px;
      -webkit-box-sizing: border-box;
         -moz-box-sizing: border-box;
              box-sizing: border-box;
    }
    .form-signin .form-control:focus {
      z-index: 2;
    }
    .form-signin input[type="text"] {
      margin-bottom: -1px;
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }
    .form-signin input[type="password"] {
      margin-bottom: 10px;
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }
    merci d'avance!!!

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Février 2008
    Messages
    154
    Détails du profil
    Informations personnelles :
    Localisation : Côte d'Ivoire

    Informations forums :
    Inscription : Février 2008
    Messages : 154
    Points : 58
    Points
    58
    Par défaut
    j'ai essayé mais ça ne marche pas,
    quand je ckique sur le bouton valider, on me remet sur la page avec le login et le mot de passe en clair

    formulaire signin.ctp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
     
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <title>GSMarches - Authentification</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
     
    	<?php
    		echo $this->Html->meta('icon');
     
    		echo $this->Html->css(
    			array(
    					//'bootstrap.min',
    					'bootstrap'
    					//,
    					//'docs'
    					//,
    					//'font-awesome'
    					//,
    					//'style'
    					//,
    					//'cake.generic',
    					//'signin'
                    )
                );
     
     
    			echo $this->Html->script(
                    array(
                        'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
                        'bootstrap.min',
                    ),
                    array('block' => 'scriptBottom')
                ); 
    	?>
     
        <!-- Le styles -->
        <!--<link href="../assets/css/bootstrap.css" rel="stylesheet">-->
        <style type="text/css">
          body {
            padding-top: 40px;
            padding-bottom: 40px;
            background-color: #f5f5f5;
          }
     
          .form-signin {
            max-width: 300px;
            padding: 19px 29px 29px;
            margin: 0 auto 20px;
            background-color: #fff;
            border: 1px solid #e5e5e5;
            -webkit-border-radius: 5px;
               -moz-border-radius: 5px;
                    border-radius: 5px;
            -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
               -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                    box-shadow: 0 1px 2px rgba(0,0,0,.05);
          }
          .form-signin .form-signin-heading,
          .form-signin .checkbox {
            margin-bottom: 10px;
          }
          .form-signin input[type="text"],
          .form-signin input[type="password"] {
            font-size: 16px;
            height: auto;
            margin-bottom: 15px;
            padding: 7px 9px;
          }
     
        </style>
        <link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">
     
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="../assets/js/html5shiv.js"></script>
        <![endif]-->
     
        <!-- Fav and touch icons -->
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
          <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
                        <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
                                       <link rel="shortcut icon" href="../assets/ico/favicon.png">
     
     
     
     
      </head>
     
      <body>
     
        <div class="container">
     
          <form class="form-signin">
    		<?php echo $this->Form->create('User',array('action'=>'login')); ?>  
    		<h2 class="form-signin-heading">Connectez-vous SVP</h2>
     
     
    		<?php 
    			echo $this->Session->flash('Auth');
     
    			echo $this->Form->input('username', array("type"=>"text", "class"=>"input-block-level", "placeholder"=>"Login"));
    			echo $this->Form->input('password', array("type"=>"password", "class"=>"input-block-level", "placeholder"=>"Password"));
     
    		?>
     
            <label class="checkbox">
              <input type="checkbox" value="remember-me">Rappel
            </label>
     
     
    		<?php echo $this->Form->end(array(
    		'label'=>__('Valider'),
    		'class'=>'btn btn-lg btn-primary btn-block',
    		'after'=>' <button class="btn">Cancel</button>'));
    		?>
     
          </form>
     
        </div> <!-- /container -->
     
        <!-- Le javascript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="../assets/js/jquery.js"></script>
        <script src="../assets/js/bootstrap-transition.js"></script>
        <script src="../assets/js/bootstrap-alert.js"></script>
        <script src="../assets/js/bootstrap-modal.js"></script>
        <script src="../assets/js/bootstrap-dropdown.js"></script>
        <script src="../assets/js/bootstrap-scrollspy.js"></script>
        <script src="../assets/js/bootstrap-tab.js"></script>
        <script src="../assets/js/bootstrap-tooltip.js"></script>
        <script src="../assets/js/bootstrap-popover.js"></script>
        <script src="../assets/js/bootstrap-button.js"></script>
        <script src="../assets/js/bootstrap-collapse.js"></script>
        <script src="../assets/js/bootstrap-carousel.js"></script>
        <script src="../assets/js/bootstrap-typeahead.js"></script>
     
      </body>
    </html>
    Quelles sont mes erreurs?
    voir piece jointe
    Images attachées Images attachées  

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Février 2008
    Messages
    154
    Détails du profil
    Informations personnelles :
    Localisation : Côte d'Ivoire

    Informations forums :
    Inscription : Février 2008
    Messages : 154
    Points : 58
    Points
    58
    Par défaut
    Probleme résolu

    il fallait que j'ajoute la methode post dans form

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <form class="form-signin" method="post">

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [SDL] Integration fenetre SDL dans fenetre C# ?
    Par salammbo dans le forum OpenGL
    Réponses: 3
    Dernier message: 07/02/2005, 09h47
  2. Integrer une musique dans mon programme
    Par Tutux84 dans le forum C
    Réponses: 2
    Dernier message: 29/01/2005, 12h41
  3. integration varaiables javascript dans du HTML
    Par developpeur_mehdi dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 10/11/2004, 14h54
  4. Integrer un carré dans un RichEdit
    Par Harry dans le forum Composants VCL
    Réponses: 3
    Dernier message: 29/09/2004, 15h02
  5. integration de repertoire dans ma webapp
    Par thomy dans le forum JBuilder
    Réponses: 2
    Dernier message: 04/06/2003, 10h34

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo