• <bdo id='jDjhK'></bdo><ul id='jDjhK'></ul>
    1. <legend id='jDjhK'><style id='jDjhK'><dir id='jDjhK'><q id='jDjhK'></q></dir></style></legend>
      <i id='jDjhK'><tr id='jDjhK'><dt id='jDjhK'><q id='jDjhK'><span id='jDjhK'><b id='jDjhK'><form id='jDjhK'><ins id='jDjhK'></ins><ul id='jDjhK'></ul><sub id='jDjhK'></sub></form><legend id='jDjhK'></legend><bdo id='jDjhK'><pre id='jDjhK'><center id='jDjhK'></center></pre></bdo></b><th id='jDjhK'></th></span></q></dt></tr></i><div id='jDjhK'><tfoot id='jDjhK'></tfoot><dl id='jDjhK'><fieldset id='jDjhK'></fieldset></dl></div>

      <small id='jDjhK'></small><noframes id='jDjhK'>

      1. <tfoot id='jDjhK'></tfoot>

        Codeigniter 扩展控制器,未找到控制器

        Codeigniter extending controller, controller not found(Codeigniter 扩展控制器,未找到控制器)
          <bdo id='8fECo'></bdo><ul id='8fECo'></ul>
                <tbody id='8fECo'></tbody>
            1. <i id='8fECo'><tr id='8fECo'><dt id='8fECo'><q id='8fECo'><span id='8fECo'><b id='8fECo'><form id='8fECo'><ins id='8fECo'></ins><ul id='8fECo'></ul><sub id='8fECo'></sub></form><legend id='8fECo'></legend><bdo id='8fECo'><pre id='8fECo'><center id='8fECo'></center></pre></bdo></b><th id='8fECo'></th></span></q></dt></tr></i><div id='8fECo'><tfoot id='8fECo'></tfoot><dl id='8fECo'><fieldset id='8fECo'></fieldset></dl></div>

              <small id='8fECo'></small><noframes id='8fECo'>

                <legend id='8fECo'><style id='8fECo'><dir id='8fECo'><q id='8fECo'></q></dir></style></legend>

                <tfoot id='8fECo'></tfoot>
                • 本文介绍了Codeigniter 扩展控制器,未找到控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Codeigniter 2.1.2 中,我想创建基本控制器,然后从该控制器扩展.它不起作用,我不知道为什么,我现在非常绝望.

                  In Codeigniter 2.1.2 I want to create base controller and then extends from this controller. It does not work and I have no idea why and I'm pretty desperate now.

                  applicationcoreMY_Base_Controller.php 我有这个:

                  <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                  
                  class MY_Base_Controller extends CI_Controller 
                  {
                      function __construct()
                      {
                          parent::__construct();
                  ...
                  

                  applicationcontrollersHome.php 我有这个:

                  <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
                  
                  class Home extends MY_Base_Controller {
                  

                  错误信息是

                  致命错误:在第 3 行的 ...applicationcontrollersHome.php 中找不到MY_Base_Controller"类

                  我不知道该怎么做,我在互联网上读到我必须将基本控制器放入核心文件夹,我必须将基本控制器命名为前缀 MY_,我做到了.但它仍然没有工作.在我的 config.php 中也是这一行

                  I have no idea what to do, I read all over the internet that I have to put base controller to core folder what I did, that I have to name base controller with prefix MY_, I did. But it is still no working. And in my config.php is this line as well

                  $config['subclass_prefix'] = 'MY_';
                  

                  我使用 xampp 在本地主机上运行这个

                  Im running this on localhost using xampp

                  感谢您的帮助

                  编辑

                  有人可以下载以下链接试试看,然后告诉我出了什么问题.我刚刚下载了 codeigniter 试图创建基本控制器并扩展欢迎控制器.不工作.在下面的 rar 中只有修改过的文件.谢谢http://goo.gl/sKHkDl

                  Could someone please downlod following link try it, and tell me whats wrong. I have just downloaded codeigniter tried to create base controller and extend welcome controller. Not working. In following rar there are just modified files. Thank you http://goo.gl/sKHkDl

                  编辑 2

                  我可以通过将 MY_Base_Controller 重命名为 MY_Controller 来使其工作.这是否意味着,我只能为控制器创建一个扩展类?例如.我不能有

                  I'm able to get this working by renaming MY_Base_Controller to MY_Controller. Does this mean, I'm able to create only one extended class for a controller ? eg. I can not have

                  • MY_Base_Auth_Controller
                  • MY_Base_Article_Controller

                  只有MY_Controller?

                  推荐答案

                  我遇到了同样的问题,但如果我在 MY_Controller.php 文件中创建所有控制器都运行良好.

                  I had the same problem, but if I created all controllers in the MY_Controller.php file all worked well.

                  <?php
                  
                  class MY_Controller extends CI_Controller
                  {
                      function __construct()
                      {
                          parent::__construct();
                          // do some stuff
                      }
                  }
                  
                  class MY_Auth_Controller extends MY_Controller
                  {
                      function __construct()
                      {
                          parent::__construct();
                          // check if logged_in
                     }
                  }
                  

                  这篇关于Codeigniter 扩展控制器,未找到控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                  1. <legend id='nU7LS'><style id='nU7LS'><dir id='nU7LS'><q id='nU7LS'></q></dir></style></legend>

                    1. <small id='nU7LS'></small><noframes id='nU7LS'>

                      <tfoot id='nU7LS'></tfoot>

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

                            <tbody id='nU7LS'></tbody>