自动加载库codeigniter3工作吗?



我有codeigniter 3x的问题,我使用php 8,在方法login_aksi未定义属性$input, $form_validation

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login extends CI_Controller {
function __construct(){
parent::__construct();

}
// menampilkan halaman login
public function index(){
$this->load->view('v_login');
}
// validasi login
function login_aksi(){
$username = $this->input->post('username');
$password = $this->input->post('password');
$sebagai = $this->input->post('sebagai');
$this->form_validation->set_rules('username','Username','required');
$this->form_validation->set_rules('password','Password','required');

this my autoload

$autoload['packages'] = array();
$autoload['libraries'] = array('database','session','form_validation');

我试图更改$ aoutload ['libraries']

您是否在设置规则后添加此代码?

if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
$this->load->view('formsuccess');
}

相关内容

  • 没有找到相关文章

最新更新