07-07-2020, 10:39 PM
hi,
I am beginner, below is my code
<?php namespace App\Controllers;
use App\Models\product
class Product extends BaseController
{
public function post()
{
$data = $userModel->findAll();
return view('home',$data);
}
//--------------------------------------------------------------------
}
can you please tell me what is wrong?
error message is "Undefined variable: data"
how to retrieve data and display in view?
I am beginner, below is my code
<?php namespace App\Controllers;
use App\Models\product
class Product extends BaseController
{
public function post()
{
$data = $userModel->findAll();
return view('home',$data);
}
//--------------------------------------------------------------------
}
can you please tell me what is wrong?
error message is "Undefined variable: data"
how to retrieve data and display in view?