codeigniter 17

Codeigniter 4🔥 [17.- bootstrap]

En este tutorial vamos a hacer un poco mas bonita nuestra tabla con bootstrap. Codigo github.com: https://github.com/programadornovato/codeigniter4/commit/4f36fe410e65ef091efbf554471bd8148fdf810d

//.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 




//app/Views/estructura/body.php
<body>
<div class="container">
    <div class="row">
        <a href="<?php echo base_url(); ?>home/formulario" class="btn btn-info" role="button" >Nuevo</a>
    </div>
    <div class="row">

    
        <table  class="table">
        <tr>
        <th scope="col">id</th>
        <th scope="col">name</th>
        <th scope="col">email</th>
        <th scope="col">deleted</th>
        <th scope="col">acciones</th>
        </tr>
        <?php
        foreach($users as $user){
            echo "<tr  scope='row' >";
            echo "<td>".$user['id']."</td>";
            echo "<td>".$user['name']."</td>";
            echo "<td>".$user['email']."</td>";
            echo "<td>".$user['deleted']."</td>";
            echo "<td>";
            echo form_button(array('name'=>'editar','type'=>'submit','class'=>'btn btn-warning','content'=>'<i class="fa fa-pencil-square-o"></i>'));
            echo form_button(array('name'=>'borrar','type'=>'submit','class'=>'btn btn-danger','content'=>'<i class="fa fa-trash"></i>'));
            echo "</td>";
            echo "</tr>";
        }
        ?>
        </table>
    </div>
</div>
</body>
</html>






//app/Views/estructura/formulario.php
<div class="container">
<?php
echo form_open('/home/guarda');
?>
<div class="form-group">
<?php
echo form_label('Nombre','name');
echo form_input(array('name'=>'name','placeholder'=>'Nombre','class'=>'form-control'));
echo "<br>";
echo form_label('Email','email');
echo form_input(array('name'=>'email','placeholder'=>'Email','class'=>'form-control'));
echo "<br>";
echo form_submit('guarda','Guardar','class="btn btn-primary"');
?>
</div>
<?php

echo form_close();
?>
</div>








//app/Views/estructura/header.php
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" >
    <title>Document</title>
</head>

Bootstrap: https://getbootstrap.com/docs/4.3/getting-started/introduction/ Fontawesome: https://www.bootstrapcdn.com/fontawesome/

#Codeigniter4 #php7 #backend #Codeigniter #php .
? Esta lista de reproducción: https://www.youtube.com/playlist?list=PLCTD_CpMeEKTFN5TDeOP-wP_hU0_9VoWg
.
Codigos en gdrive: https://drive.google.com/file/d/1awbG6jI40IO0N68fgjLUwNFpsTC3wIHj/view?usp=sharing .
Gracias por apoyar este canal: https://www.patreon.com/programadornovato?fan_landing=true .
? Facebook: https://facebook.com/ProgramadorNovatoOficial
? Twitter: https://twitter.com/programadornova
? Linkedin: https://www.linkedin.com/in/programadornovato/
? Instagram: https://www.instagram.com/programadornovato/

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *