Listing code program CI Controller menggunakan CSS




1.       File “c_tugascss.php” yang berada di dalam folder “controller”.
<?php
class c_tugascss extends CI_Controller{
function tugas(){
          $this->load->model("m_identitas");
          $data=array();
          $data["tugas"]=$this->m_identitas->tugas;
          $this->load->view("v_c_hellotugas",$data);
          }
}
?>

2.       File “m_identitas.php” yang berada di dalam folder “model”.
<?php
class m_identitas extends CI_Model{
var $tugas=array(
                          "NIM"=>"14.11.0110",
                          "Nama"=>"Taufik Ari Arnandan",
                          "Kelas"=>"TI 14 B"
                          );
}
?>



3.       File “v_c_hellotugas.php” yang berada di dalam folder “view”.
<html>
<head>
      <title>Hello Tugasku !!</title>
            <style type="text/css">
            #container{
                   margin: 20px;
                                           border: 1px solid #d0d0d0;
                                           background: #fff000;
                                           height: 600px;
                                           width: 1300px;
                                           font-size: 50px;
                                           -webkit-box-shadow: 0 0 8px #d0d0d0;
                                           }
                          </style>
</head>
<body>
<center>
<div id="container">
<?php
echo "Tugas Framework Web<br/><br/>";
$biodata=array_keys($tugas);
$ulang=sizeof($biodata);


For ($c=0;$c<$ulang;$c++){
          echo "<br />";
echo $biodata[$c]." : ".$tugas[$biodata[$c]];
}
?>
</div>
</center>
</body>
</html>

4.       Hasil output program :


EmoticonEmoticon