在代码点火器中,我收到以下消息:
Unable to load the requested file: home.php
控制器:
cp/
Login
视图:
cp/
home.blade.php
class Login extends BaseController {
public function __construct(){
parent::__construct();
}
function index()
{
$this->load->view('home','');
}
}
或:
class Login extends BaseController {
public function __construct(){
parent::__construct();
}
function index()
{
$this->load->view('cp/home','');
}
}
http://www.vitrinsaz1.ir/Mobile/Vitrinsaz/Pannel/cp/login
嗨,加载视图时,请记住确保正确命名,就像在您的实例中一样,您可以执行以下操作:
function index()
{
$this->load->view('home_blade');
}
删除文件名中的句点并将其替换为下划线,然后确保视图文件本身命名为home_blade.php
嘿,我也遇到了这个错误,我的错误通过重新检查父文件夹名称来解决。尝试替换cp.
$this->load->view('cp/home');
用这个
$this->load->view('Cp/home');
我认为这可能是问题所在。。我的代码在localhost上运行良好,但在服务器上没有加载视图。这个解决了我的错误。
如果代码是正确的,并且您仍然遇到错误,请更改文件夹权限:
chmod-R777";您的文件夹";
我有一个类似的问题,它解决了。