Welcome Guest, Not a member yet? Register   Sign In
Call to undefined function form_open() in CI 4
#1

I am using CodeIgniter 4 and loading form helper in the following way, but it still says,

Call to undefined function form_open()

In BaseController.php i am autoloading form helper.

protected $helpers = ["form"];
Route:

$routes->get('admin/login', 'admin\LoginController::index');
Controller:

public function index()
{
   
    echo view('admin/login');
}
View:

<?php echo form_open('admin/dologin');?>
    <?= csrf_token() ?>
    <div class="input-group mb-3">
      <input type="email" class="form-control" name="email" placeholder="Email">
      <div class="input-group-append">
        <div class="input-group-text">
          <span class="fas fa-envelope"></span>
        </div>
      </div>
    </div>
    <div class="input-group mb-3">
      <input type="password" class="form-control" name="password" placeholder="Password">
      <div class="input-group-append">
        <div class="input-group-text">
          <span class="fas fa-lock"></span>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-4">
        <button type="submit" class="btn btn-primary btn-block">Sign In</button>
      </div>
      <!-- /.col -->
    </div>
  <?php echo form_close();?>
How can i get rid of from this error?

Call to undefined function form_open()
Reply
#2

Hi, please see https://github.com/codeigniter4/CodeIgni...ssues/6287
Iran,talesh,datamweb Heart
Reply




Theme © iAndrew 2016 - Forum software by © MyBB