Welcome Guest, Not a member yet? Register   Sign In
I am a newbie in codeigniter. How to fix this error.
#1

[eluser]Unknown[/eluser]
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$view

Filename: controllers/blog.php

Line Number: 7

My blog.php (controller is)

<?php
class Blog extends CI_Controller{

public function index()
{

$this->home();

}

public function home(){
$this->load->view['homeview'];
}
}

?>

homeview.php

<!DOCTYPE html>
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Welcome to CodeIgniter&lt;/title&gt;
&lt;link rel="stylesheet" href="application/views/main.css" type="text/css"/&gt;
&lt;/head&gt;
&lt;body&gt;

<div id="big_wrapper">
<h1>Suresh KUMAR Mukhiya</h1>


&lt;/body&gt;
&lt;/html&gt;






#2

[eluser]Chathuranga Tennakoon[/eluser]
the problem occurs because you have used square brackets instead of parentheses.
Code:
problem :   $this->load->view[‘homeview’]; // you have used square brackets

solution :    $this->load->view(‘homeview’); //user parentheses
#3

[eluser]cideveloper[/eluser]
Chathuranga is correct.

also please use code blocks when posting code. Makes it a lot easier to read. Thanks
#4

[eluser]InsiteFX[/eluser]
I had EllisLabs add the code tags to the top of New Topic, But they need to read...




Theme © iAndrew 2016 - Forum software by © MyBB