0

I’m trying to make a form, but it can’t be loaded in view. I’m using Bootstrap.My controller code is:

<?php

class Boot extends CI_Controller {
      public function __construct() {
        parent::__construct();
    }

    function index() {

        $this->load->helper('form');
        $this->load->library('form_validation');

        // $data['form_css'] = array('class' => 'form-control');
        $this->load->view('bootview');
        $this->load->view('forma');

    }
}

My view is:

<html>
<head>
<link rel="stylesheet"  href="<?php echo base_url("assets/css/bootstrap.css"); ?>" />
</head>
<body>
<h2>Create a news item</h2>

    <?php echo validation_errors(); ?>

    <?php echo form_open('boot/index') ?>
        <div class="form-group">

        <label for="name">Name:</label>
        <input type="text" id="name" class="form-control" autofocus name="name" placeholder="Name"></br></br>
        <input type="submit" name="submit" value="Create news item" />
        </div>
    </form>
2
Contributors
4
Replies
15
Views
2 Years
Discussion Span
Last Post by iveto89
0

Hmm, class names are not case sensitive, but I believe I remember hearing of an issue with autoload etc being case sensitive for what ever reason. Also, you're missing a closing ';' after your function.

try
<?php echo form_open('Boot/index'); ?>

if that doesn't work, then try
<?php echo form_open('Boot/index/'); ?>

and finally
<?php echo form_open('Boot'); ?>

0

I hadn't pasted the correct link for Bootstrap i head tag :) That was the reason :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.