Integrate a Bootstrap Template into Code Igniter Learning Basics of MVC Frameworks



https://i.ytimg.com/vi/xrgWY2fLOn0/hqdefault.jpg



Learn how to integrate a Bootstrap 3.0 Template from StartBootstrap into CodeIgniter and get introduced to building sites powered by the framework.

Original source


30 responses to “Integrate a Bootstrap Template into Code Igniter Learning Basics of MVC Frameworks”

  1. thx its help me alot
    Bro I Just wanna thank you for these videos.
    Brother You are doing a fabulous job.
    I am beginner in Codeigniter and your videos gives me a good initiative to learn this,
    Most important is your are explaining each and everything , Within 3 days i learn a lot. Keep Going On Bro. Thanx : – )

    http://sumberkoneksiindonesia.com/
    http://ispmurah.com/
    http://cepatnet.com/
    http://fiberoptikinternet.com/
    http://providerinternetdedicated.com/
    http://ispdedicated.com

  2. I've got lots of PHP experience, and some Bootstrap & CodeIgniter experience; the pace on this tutorial was perfect for me! I totally giggled when, under your breath, you'd say "What happened here?" I like that you didn't delete that kind of thing; we learn best from things not working…and from seeing how other people solve it when things don't work for them.

    I have a few questions, if you're up for answering them. You put the echo base url command in the HTML in front of the subdirectories…what stopped you from just making them absolute links instead…i.e. putting a "/" in front of the directory name? Also, you mentioned at one point that you deleted other stuff you didn't need that came with CodeIgniter. I'm not sure what else you deleted, but I did notice the doc-root directory was MIA. I'm curious what else you nixed, and what was behind the decision to delete the doc-root? (Not questioning your decision…just interested in learning.)

    Thx again for putting this tutorial together. Looks like it helped lots of people, and it was interesting to see how someone else is implementing CodeIgniter and implementing Bootstrap inside it. I've started watching your next tutorial, too, and am looking forward to finishing it…but first…I need to get a Bootstrap template inside my CodeIgniter. 🙂

  3. Hi! I want to say thank for your effort from Hungary! Your video is very usefull and helpful. I have to learn Codeigniter because i have got my first developer job few day ago. I watched some other videos, but yours is my own favorite. I am starting to follow your chanel. Can i get your Skpye or another contact? 🙂

  4. Dude really nice but i want to ask something , how can we change the nav links (home , about) dynamically.
    ex- at home page only about link will be display and at about page only home link will be display.
    Please tell us

  5. I am developing admin panel using codeigniter. How to compare the username and password form database?.whatever i am typing in username and password its going on next page …but my username and password is different in database.Below are the code which i done but its not working. i am fresher in codeigniter.Please help me in this…..

        *1) view page*     
    <html>
    <head><title> Admin Login</title>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <script src="js/bootstrap.min.js"></script>

    </head>
    <body>

    </br></br>

    <div class="container row text-center">
        <div class="row">
          <div class="span4"></div>
          <div class="span4"><img class="center-block" src="../img/H.png" style="margin: 0 auto; width:85; height:85;" /></div>
          <div class="span4"></div>
      </div>

    </br></br></br>

    <form name="form" method="post" action="<?php echo site_url("home/chkLogin");?>">

    <div class="fs-fields">
    <input type="text" name="txtUsername" placeholder="Enter your Email ID"  id="q1" style="">

     <div class="span12"><img class="fs-fields" src="../img/line.png" style="  margin-left:10px;width:400px; height:7;" /></div>

    <input type="password" name="txtPassword" placeholder="Password" id="q1" class="other">

          <div class="span4"></div>
          <div class="span4"><img class="fs-fields" src="../img/line.png" style="margin-left:10px;width:400px; height:7;" /></div>
          <div class="span4"></div>

    </div>
    </br>
    </br>

    <input  class="btn-align" type="image"   name="btnSubmit" src="../img/proceed1.png" onmouseover="this.src='../img/proceed2.png'" onmouseout="this.src='../img/proceed1.png'" >

    </form>

     </div>
    </div>
    </body>
    </html>

        *2) Controller*
          ?php  
       class home extends CI_Controller  
       {  
          public function index()  
          {  
             //load the database  
             $this->load->database();  
             //loginform
             $this->load->view('login_view');

          }  
       public function chkLogin(){

        // Validate
        $this->load->library('form_validation');
       $this->form_validation->set_rules('txtUsername', 'Username','required');
        $this->form_validation->set_rules('txtPassword','Password','required');

        // INPUT

        $username = $this->input->post('txtUsername');
        $password = $this->input->post('txtPassword');
        $password = md5($password);

        // VALIDATE FORM

        if( $this->form_validation->run() == FALSE ){
            // Invalid

              $this->load->view('login_view');

        }else{
            // Valid

            $this->load->model('select'); 

            if($this->select->chkLogin($username, $password)){
                // Logged In
                $this->session->set_userdata('username',$username); // SET SESSION
            }else{
                // Invalid Credentials
                $data['error']="Invalid credentials. n Please try again !";
                $this->load->view('select_view',$data);
            }
        }
    }
       } 

    ?>   

        *3) Model*

        <?php  
       class select extends CI_Model  
       {  
          function __construct()  
          {  
             // Call the Model constructor  
             parent::__construct();  
          }  
          //we will use the select function  

    public function chkLogin($_username, $_password)
    {

        $_qry = "SELECT * FROM admin_login WHERE Username = '".$_username."' AND Password = '".$_password."' ";

        $_res = $this->db->query($_qry);

        if ($_res->num_rows() > 0)
        {        
            return TRUE ;    
        }
       else 
       {
          return FALSE;
       }
    }

       }  
    ?>

Leave a Reply