0

base_url()Codeigniter は、他のコントローラーで動作し、URL ヘルパーが自動ロードされていても、特定のコントローラーで を認識しません。これにより、影響を受けるコントローラーは HTML を表示しますが、CSS や JS などの必要なアセットは表示しません。

スタイルシートを適切にロードするために、問題のあるコントローラーのビューをhttp://localhost/sub/app/assets/css/style.cssHTML に表示する必要があるとしますが、代わりにhttp://localhost/sub/app/controller/method/assets/css/style.css.

これは、ログがそのために言わなければならないことです。

その特定のグリッチ コントローラーの場合:

DEBUG - 2013-05-08 18:02:18 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:18 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:19 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:19 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:19 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:19 --> Controller Class Initialized
DEBUG - 2013-05-08 18:02:19 --> File loaded: bulletin/views/fragments/header.php
DEBUG - 2013-05-08 18:02:19 --> File loaded: bulletin/views/fragments/navbar.php
DEBUG - 2013-05-08 18:02:19 --> File loaded: bulletin/views/manage/site-sidebar.php
DEBUG - 2013-05-08 18:02:19 --> File loaded: bulletin/views/fragments/footer.php
DEBUG - 2013-05-08 18:02:19 --> File loaded: bulletin/views/manage/site.php
DEBUG - 2013-05-08 18:02:19 --> Final output sent to browser
DEBUG - 2013-05-08 18:02:19 --> Total execution time: 0.4196
DEBUG - 2013-05-08 18:02:19 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Config Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> URI Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Router Class Initialized
DEBUG - 2013-05-08 18:02:19 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Output Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Security Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:20 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:20 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:20 --> Input Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:20 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:20 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:02:20 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:20 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:20 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:20 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:20 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:20 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:20 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:20 --> Controller Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:20 --> Controller Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: html_helper
ERROR - 2013-05-08 18:02:20 --> 404 Page Not Found --> manage/assets
DEBUG - 2013-05-08 18:02:20 --> Controller Class Initialized
ERROR - 2013-05-08 18:02:20 --> 404 Page Not Found --> manage/assets
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: url_helper
ERROR - 2013-05-08 18:02:20 --> 404 Page Not Found --> manage/assets
DEBUG - 2013-05-08 18:02:20 --> Controller Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:20 --> Controller Class Initialized
DEBUG - 2013-05-08 18:02:20 --> Controller Class Initialized
ERROR - 2013-05-08 18:02:20 --> 404 Page Not Found --> manage/assets
ERROR - 2013-05-08 18:02:20 --> 404 Page Not Found --> manage/assets
ERROR - 2013-05-08 18:02:20 --> 404 Page Not Found --> manage/assets

動作中のコントローラーのログは次のとおりです。

DEBUG - 2013-05-08 18:01:59 --> Config Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Hooks Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Utf8 Class Initialized
DEBUG - 2013-05-08 18:01:59 --> UTF-8 Support Enabled
DEBUG - 2013-05-08 18:01:59 --> URI Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Router Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Output Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Security Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Input Class Initialized
DEBUG - 2013-05-08 18:01:59 --> Global POST and COOKIE data sanitized
DEBUG - 2013-05-08 18:01:59 --> Language Class Initialized
DEBUG - 2013-05-08 18:02:00 --> Loader Class Initialized
DEBUG - 2013-05-08 18:02:00 --> Config file loaded: bulletin/config/config.php
DEBUG - 2013-05-08 18:02:00 --> Helper loaded: html_helper
DEBUG - 2013-05-08 18:02:00 --> Helper loaded: url_helper
DEBUG - 2013-05-08 18:02:00 --> Controller Class Initialized
DEBUG - 2013-05-08 18:02:00 --> File loaded: bulletin/views/fragments/header.php
DEBUG - 2013-05-08 18:02:00 --> File loaded: bulletin/views/fragments/navbar.php
DEBUG - 2013-05-08 18:02:00 --> File loaded: bulletin/views/fragments/breadcrumb.php
DEBUG - 2013-05-08 18:02:00 --> File loaded: bulletin/views/fragments/footer.php
DEBUG - 2013-05-08 18:02:00 --> File loaded: bulletin/views/dashboard.php
DEBUG - 2013-05-08 18:02:00 --> Final output sent to browser
DEBUG - 2013-05-08 18:02:00 --> Total execution time: 0.4465

更新:グリッチコントローラーは次のとおりです。

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Manage extends CI_Controller {

    public function site($section = '')
    {
        if($section == 'general')
            redirect('/manage/site','refresh');
        elseif (!empty($section))
            $this->load->view('manage/site-'.$section);
        else
            $this->load->view('manage/site');
    }

}

/* End of file manage.php */
/* Location: ./app/bulletin/controllers/manage.php */

必要に応じて詳細を提供します。

ありがとう!

4

0 に答える 0