blank screen on CI |
[eluser]davy_yg[/eluser]
Hello, I wonder why I see blank screen on CI. controllers/page.php Code: <?php views/index.php Code: <html> routes.php Code: $route['default_controller'] = "page"; Thanks.
[eluser]LuckyFella73[/eluser]
What happens when you test like this: Code: <?php Just to know if the view file is buggy I never tested if it woks - you include view files in your view instead of loading the CI way.
[eluser]davy_yg[/eluser]
It works: http://localhost/IndonusaCI/index.php/page Result: Controller loaded but it doesn't work if I replace: echo "Controller loaded"; with $this->load->view('index'); http://localhost/IndonusaCI/index.php/page Result: Blank screen
[eluser]CroNiX[/eluser]
try changing the view's filename to something other than "index.php".
[eluser]davy_yg[/eluser]
Why not? I basically trying to make this link works: http://localhost/IndonusaCI/ Later on will be www.indonusa.net.id There shouldn't be any other name behind it.
[eluser]LuckyFella73[/eluser]
You can have your links like you want - all he suggested is to rename the VIEW file. You don't see the name of the view file in your url.
[eluser]davy_yg[/eluser]
what should I name the controller since I will have to put the controller name in the url right?
[eluser]LuckyFella73[/eluser]
You don't need to rename the controller. Just try this: Code: <?php And rename your index.php file (the view file) to "home.php" Your url in your browser is still the same that way.
[eluser]davy_yg[/eluser]
Well, if the class name is page then I will have to type: http://localhost/IndonusaCI/index.php/page to load it right? Is it possible to load if I would like to type only localhost/IndonusaCI/ ?
[eluser]LuckyFella73[/eluser]
Quote:Well, if the class name is page then I will have to type: Yes that's right. You can use .htaccess and call the page http://localhost/IndonusaCI/page And/ or edit your routes.php and set the controller "page" as the "default_controller" instead of "home" then you have to type just the base url http://localhost/IndonusaCI/ to get that page. |
Welcome Guest, Not a member yet? Register Sign In |