Error Fatal error: Call to undefined method CI_Loader::views() |
12-26-2017, 06:43 AM
(This post was last modified: 12-28-2017, 07:15 AM by ciadmin. Edit Reason: Added code tags )
Hello,
I'm beginners to build website from codeigniter, I'm having problem access link : http://server.kennazjulian.com/index.php/House/halo Message Error is : Fatal error: Call to undefined method CI_Loader::views() in /home/rootkenz/public_html/application/controllers/House.php on line 17 A PHP Error was encountered Severity: Warning Message: Cannot modify header information - headers already sent by (output started at /home/rootkenz/public_html/application/controllers/House.php:17) Filename: core/Common.php Line Number: 564 Backtrace: A PHP Error was encountered Severity: Error Message: Call to undefined method CI_Loader::views() Filename: controllers/House.php Line Number: 17 Backtrace: Whats wrong from my configuration? This is script in views/View_house.php : Code: [color=#000000][size=medium][font=Times New Roman]<html>
You can use this code
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Test extends CI_Controller { function __construct() { parent::__construct(); } function index() { $output['left_menu'] = 'test'; $output['left_submenu'] = 'test'; $this->load->view('default/includes/header',$output); $this->load->view('default/test/index'); $this->load->view('default/includes/footer'); } } You are using incorrect format for loading file. (12-28-2017, 12:21 AM)XtreemDeveloper Wrote: You can use this code Hallo, Thanks for you Response, but is there a wrong configuration of the script to me? ![]() ![]()
Your not loading the header or footer in your view.
Your view should be defined something like this: Code: <!DOCTYPE html> Show your code for your header and footer views. The error is stating that you our outputting data before the view is completely loaded. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(12-30-2017, 05:14 AM)InsiteFX Wrote: Your not loading the header or footer in your view. You're right about the html being malformed but wrong about what the error means. The primary error is that a call was made to a method that does not exist in CI_Loader. Line 17 of House.php probably looks like this. PHP Code: $this->load->views('View_house'); But there is no method views() in CI_Loader. The line should be. PHP Code: $this->load->view('View_house'); If the OP made that change and is still getting an error message the error is not about a "Call to undefined method CI_Loader::views() in /home/rootkenz/public_html/application/controllers/House.php on line 17".
Hi Dave,
I did not mention that error because he said he fixed it from above. But thanks for clarifying it for me. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |