简体   繁体   中英

admin page in codeigniter

i have created a folder abc in application\\controllers.

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

class Acc_controller extends CI_Controller {


    public function index()
    {

        $this->load->view('abc/index1');

    }
}

After that i have created files in view\\abc. i named it as index1.php

<li> Mauris risus tellus, sodales quis, sagittis vitae, molestie sed,
nunc. Fusce ornare, turpis vel rutrum blandit, enim diam aliquet purus,
vel accumsan risus enim sit amet nisl. Ut fringilla ornare libero. Nunc
sodales. </li>

the problem is that i am unable to access this file. but when i place the controller file out of abc folder to controller foler then it works. why it doesnot work if i place it in any new folder in controller folder.

This link may help you:

http://codeigniter.com/forums/viewthread/190563/

A while back I ran into this very problem but it was a slightly earlier version. I ended up extending the loader class and got it to work as expected. Shouldn't be too hard and you don't need to mess with routes or htaccess. The MY_Loader class should be enough.

CodeIgniter supports this by default - it fails at multiple levels, so you can only go one folder deep.

Make sure you are accessing the controller by calling the folder in the URL first:

http://localhost/yourapp/abc/acc/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM