0

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.

Saveen
  • 4,120
  • 14
  • 38
  • 41
  • 1
    Possible duplicate of https://stackoverflow.com/questions/1475297/phps-white-screen-of-death (based on _“appears a blank page”_) – 04FS Jun 04 '19 at 12:22
  • i think a mix between which you have commented and this one, but this one not has a solution answer https://stackoverflow.com/questions/35480528/codeigniter-testing-the-base-url – Andrés Mangas Jiménez Jun 04 '19 at 13:01
  • 1
    Enable error reporting or check the server logs, to find out what went wrong. – 04FS Jun 04 '19 at 14:08

2 Answers2

1

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.

Akshay Rathod
  • 31
  • 1
  • 1
  • 4
0

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.