Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 试图在现有的codeigniter应用程序中加载视图,需要关于我得到的错误的建议吗_Php_Codeigniter - Fatal编程技术网

Php 试图在现有的codeigniter应用程序中加载视图,需要关于我得到的错误的建议吗

Php 试图在现有的codeigniter应用程序中加载视图,需要关于我得到的错误的建议吗,php,codeigniter,Php,Codeigniter,我刚开始开发codeigniter应用程序 这个项目很简单,我只需要创建一个视图并从数据库中获取一些数据 然而,当我试图访问视图时,我总是会遇到这些错误 我不知道这些错误是什么意思 这是我用来在默认控制器类中加载视图的代码,它是该类中索引函数的一个单独函数 function watchlist(){ $this->load->view("watchlist_view"); } 以下是我在浏览器中访问视图的方式 localhost/watchl

我刚开始开发codeigniter应用程序

这个项目很简单,我只需要创建一个视图并从数据库中获取一些数据

然而,当我试图访问视图时,我总是会遇到这些错误

我不知道这些错误是什么意思

这是我用来在默认控制器类中加载视图的代码,它是该类中索引函数的一个单独函数

function watchlist(){
            $this->load->view("watchlist_view");
        }
以下是我在浏览器中访问视图的方式

localhost/watchlist/index.php/home/watchlist
这里是我得到的错误

    A PHP Error was encountered

Severity: Warning

Message: session_start(): open(C:/xampp/session_data/localhost\sess_v4oapdmdqjq0s7b1i5j8mb8u95, O_RDWR) failed: No such file or directory (2)

Filename: helpers/session_helper.php

Line Number: 18


Fatal error: Call to undefined method Home::load() in C:\xampp\htdocs\watchlist\application\controllers\home.php on line 23

Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163

Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163

Warning: include(application/errors/error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163

Warning: include(): Failed opening 'application/errors/error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\watchlist\system\libraries\Exceptions.php on line 163
构造函数主代码

class Home extends Controller
    {

        var $ministry_name = "Security";

        function Home()
        {
            parent::Controller();
        }

        function index()
        {
            Removed local redirect. All sites will now redirect to main site
            //Added a check to see if the user is still logged in.  If so, remain on the site.
            if (!$this->authorization->checklogin())
            {
                header('Location: http://mainsite.org/');
                exit;

            }
            else
            {
                redirect("/home/main");
                exit();
            }

        }

        function watchlist(){
            //Loads watchlist view
            $this->load->view("watchlist_view");
        }

看。在这里,您应该扩展CI_控制器而不是控制器,并且您可以使用通用构造函数和父构造函数::u构造函数;而不是旧的同名样式。

好的,我要试试这个。谢谢