codeigniter How to use the CI libraries and helper Helper


Example

Autoload your helper function. if you use many time in your project

$autoload['helper'] = array('url', 'form');

Use form helper in view

<?php echo form_open('Public/Login/loginAuth'); ?>

<?php
       echo "<div class='row'>";
       echo "<label for='inputEmail' class='col-lg-2 control-label col-lg-offset-2 col-md-2 control-label col-md-offset-2 col-sm-2 control-label col-sm-offset-2'>Enter Email</label>";
       $email = array(
          "name"=>"email",
          "placeholder"=>"Email",
          "class"=>"form-control"
          );

     echo "<div class='col-lg-6 col-md-6 col-sm-6'>";
     echo form_error('email');
    echo form_input($email)."<br/>";
  echo "</div>";
echo "</div>";

echo "<div class='row'>";
    echo "<label for='inputPassword' class='col-lg-2 control-label col-lg-offset-2 col-md-2 control-label col-md-offset-2 col-sm-2 control-label col-sm-offset-2'>Enter Password</label>";
  $password = array(
    "name"=>"password",
    "placeholder"=>"Password",
      "class"=>"form-control"
    );

  echo "<div class='col-lg-6 col-md-6 col-sm-6'>";
    echo form_error('password');
    echo form_password($password)."<br/>";
  echo "</div>";
echo "</div>";

echo "<div class='row'>";
  
  $submit = array(
    "name"=>"submit",
    "value"=>"Submit",
    "class"=>"btn btn-primary col-lg-offset-9 col-md-offset-9 col-sm-offset-9 col-xs-offset-9"
    );
  echo form_submit($submit)."<br/>";

echo "</div>";

?>