0

I am trying to create a form using HMVC in codeigniter but it is showing Fatal error: Call to undefined function form_open() error I included Controller.php , Modules.php and MY_Router.php in application/library folder, again it is showing error.. here is my code:- for controller :-

<?php
class First extends MX_Controller {
    public function index()
    {
        $this->load->view('welcome_message');
    }
}

?>

for view :-

<html>
<body>
    <h1> hey this is first module.. </h1>
    <?php

        echo form_open('first/login');
        echo form_input('username',username);
        echo form_password('password',password);
        echo form_submit('Login',submit);
        form_close();

    ?>
</body>

avinashse
  • 1,440
  • 4
  • 30
  • 55

1 Answers1

2

You need to load the form helper:

$this->load->helper('form');
Yan Berk
  • 14,328
  • 9
  • 55
  • 52
  • Thanks :) Is there any other method to do that? `

    hey this is first module..

    load->helper('form'); echo form_open('first_module/first/login'); echo form_input('username',set_value('firstname','firstname')); echo form_password('password',set_value('firstname','firstname')); echo form_submit('submit','Login'); form_close(); ?> `
    – avinashse Jun 30 '12 at 08:39
  • I am actually asking that I am doing this :- `form_open('first_module/first/login');` Is this the right method to do that..? – avinashse Jun 30 '12 at 08:42
  • Again another problem with data insertion in database :( – avinashse Jun 30 '12 at 09:31