Hier mein Controller istundefinierte Variable in Ansichten in codeigniter
class Admin extends CI_Controller {
function __construct(){
parent::__construct();
}
public function index($msg = NULL) {
$data['msg'] = $msg;
$this->load->view('pages/sign-in');
}
public function process(){
// Load the model
$this->load->model('admin/Admin_model');
// Validate the user can login
$result = $this->Admin_model->validate();
// Now we verify the result
if(! $result){
// If user did not validate, then show them login page again
$msg = '<font color=red>Invalid username and/or password.</font><br />';
$this->index($msg);
}else{
// If user did validate,
// Send them to members area
redirect(base_url().'index.php/home');
}
}
und hier ist View-Datei Ich verwende:
if(! is_null($msg)) echo $msg;
es zeigt
undefinierte Variable $ msg
Und welche Route verwenden Sie, um auf den Index-Controller zuzugreifen? – ajmedway
Füttern in irgendwelchen Argumenten? – ajmedway
http://betaonetesting.com/watch_new/index.php/admin – Pardeep