简体   繁体   中英

How to set up codeigniter?

I'm trying to set up Codeigniter in my mac, but with no luck. When loading every page, appears a blank page.

I'm following the Codeigniter tutorial from the official site. Checked the base URL configured in config.php, but seems to be ok, now: http://localhost:8080/

Also, the directory where there is the file that I'm trying to open seems to be in the correct folder: nfs://192.168.64.2/opt/lampp/htdocs/application/views/pages

The pages.php code is the next:

<?php
class Pages extends CI_Controller {

    public function view($page = 'home')
    {
    }
}

I expected to load about.php and appear the header, about page and footer.

to load the view in codeigniter, you need to add below line of code in your controller function.

$this->load->view($page);

note: I am assuming that you have all the view pages are located at the route of application/views/ folder.

When you download Codeigniter and is extracted, generate a "Codeigniter xxx" folder with files. Is necessary to copy this folder to htdocs folder and rename with the name that you want for your project.

If you copy the files instead the folder inside htdocs, could produce this problem.

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