• <small id='XRpg6'></small><noframes id='XRpg6'>

        • <bdo id='XRpg6'></bdo><ul id='XRpg6'></ul>
        <legend id='XRpg6'><style id='XRpg6'><dir id='XRpg6'><q id='XRpg6'></q></dir></style></legend>
        <tfoot id='XRpg6'></tfoot>
        <i id='XRpg6'><tr id='XRpg6'><dt id='XRpg6'><q id='XRpg6'><span id='XRpg6'><b id='XRpg6'><form id='XRpg6'><ins id='XRpg6'></ins><ul id='XRpg6'></ul><sub id='XRpg6'></sub></form><legend id='XRpg6'></legend><bdo id='XRpg6'><pre id='XRpg6'><center id='XRpg6'></center></pre></bdo></b><th id='XRpg6'></th></span></q></dt></tr></i><div id='XRpg6'><tfoot id='XRpg6'></tfoot><dl id='XRpg6'><fieldset id='XRpg6'></fieldset></dl></div>
      1. 找不到代码点火器 MY_Controller

        codeigniter MY_Controller not found(找不到代码点火器 MY_Controller)

            <bdo id='k0fU8'></bdo><ul id='k0fU8'></ul>

            <i id='k0fU8'><tr id='k0fU8'><dt id='k0fU8'><q id='k0fU8'><span id='k0fU8'><b id='k0fU8'><form id='k0fU8'><ins id='k0fU8'></ins><ul id='k0fU8'></ul><sub id='k0fU8'></sub></form><legend id='k0fU8'></legend><bdo id='k0fU8'><pre id='k0fU8'><center id='k0fU8'></center></pre></bdo></b><th id='k0fU8'></th></span></q></dt></tr></i><div id='k0fU8'><tfoot id='k0fU8'></tfoot><dl id='k0fU8'><fieldset id='k0fU8'></fieldset></dl></div>
              <tfoot id='k0fU8'></tfoot>
            • <small id='k0fU8'></small><noframes id='k0fU8'>

                <tbody id='k0fU8'></tbody>
                <legend id='k0fU8'><style id='k0fU8'><dir id='k0fU8'><q id='k0fU8'></q></dir></style></legend>

                  本文介绍了找不到代码点火器 MY_Controller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在网站上使用 Codeigniter.2.1.3,所以我需要扩展 CI_Controller 以便我可以添加一个要与所有控制器一起执行的方法,所以我做了 user_guide 中的内容:

                  i’m using the Codeigniter.2.1.3 for a website, so i need to extend the CI_Controller so i can add a method to be executed with all controllers so i did what’s in the user_guide:

                  在 application/core 文件夹中创建一个名为 MY_Controller.php 的文件,在其中创建扩展 CI_Controller 的 MY_Controller 类,更改我的常规控制器以扩展 MY_controller,如下所示:MY_controller.php:

                  creating a file named MY_Controller.php in the application/core folder the creating in it MY_Controller Class that extends the CI_Controller, the changing my regular controller to extend the MY_controller like this: MY_controller.php:

                  class MY_Controller extends CI_Controller{
                      protected $page;
                      # Constructor
                      function __construct (){
                          parent::__construct();
                          #code shared with all controllers
                      }
                      public function get_page(){
                          #code to get_the right page here
                      }
                  }
                  

                  名为 Regular.php 的常规控制器:

                  regular controller named Regular.php:

                  class Regular extends MY_Controller{
                       public function __construct(){
                           parent::__construct();
                       }
                       public function index(){
                            $this->get_page();
                       }
                  }
                  

                  但不断出现以下错误:

                  致命错误:在第 2 行的/var/www/immo/CodeIgniter_2.1.3/application/controllers/regular.php 中找不到MY_Controller"类

                  Fatal error: Class ‘MY_Controller’ not found in /var/www/immo/CodeIgniter_2.1.3/application/controllers/regular.php on line 2

                  推荐答案

                  您需要包含您的 MY_Controller 类或自动加载它.我建议您通过将以下内容添加到您的 application/config/config.php 文件来自动加载它.

                  You would need to include your MY_Controller class or auto-load it. I suggest you auto-load it by adding the following to your application/config/config.php file.

                  function __autoload($class)
                  {
                      if (strpos($class, 'CI_') !== 0)
                      {
                          if (file_exists($file = APPPATH . 'core/' . $class . EXT))
                          {
                              include $file;
                          }
                      }
                  } 
                  

                  这篇关于找不到代码点火器 MY_Controller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tbody id='CqGs0'></tbody>

                    <i id='CqGs0'><tr id='CqGs0'><dt id='CqGs0'><q id='CqGs0'><span id='CqGs0'><b id='CqGs0'><form id='CqGs0'><ins id='CqGs0'></ins><ul id='CqGs0'></ul><sub id='CqGs0'></sub></form><legend id='CqGs0'></legend><bdo id='CqGs0'><pre id='CqGs0'><center id='CqGs0'></center></pre></bdo></b><th id='CqGs0'></th></span></q></dt></tr></i><div id='CqGs0'><tfoot id='CqGs0'></tfoot><dl id='CqGs0'><fieldset id='CqGs0'></fieldset></dl></div>
                  • <small id='CqGs0'></small><noframes id='CqGs0'>

                      <bdo id='CqGs0'></bdo><ul id='CqGs0'></ul>

                            <tfoot id='CqGs0'></tfoot>

                            <legend id='CqGs0'><style id='CqGs0'><dir id='CqGs0'><q id='CqGs0'></q></dir></style></legend>