Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Using $this when not in object context
#7

[eluser]beatryder[/eluser]
[quote author="flumps" date="1187061317"]I just new I was gunna get flamed.

no wonder why most people complain about things not working cause there so scared to ask for help without getting flamed.

1. im not a web developer.

2. my friend set it all up for me and coded the site for me.

3. hes on holiday before you flame me asking ask him.

4. hes on the very tip of scotland with no web access so no I cant text or phone him to sort it out.

5. I did ask for help from another friend be her referred me to these forums instead.

yeah sure my pages.php file looks like this:

Quote:<?php

class Pages extends Controller {

function Pages()
{
parent::Controller();
}

function index()
{
$this->load->view('index_view');
}
function about()
{
$this->load->view('welcome_message');
}
function hosting()
{
$this->load->view('hosting_view');
}
function resellers()
{
$this->load->view('resellers_view');
}
function dedicated()
{
$this->load->view('dedicated_view');
}
function contact()
{
$this->load->helper(array('form', 'url'));

$this->load->library('validation');


$rules['name'] = "required";
$rules['email'] = "required";
$rules['comment'] = "required";

$this->validation->set_rules($rules);

if ($this->validation->run() == FALSE)
{
$this->load->view('contact_view');
}
else
{
$this->load->library('email');

$this->email->from($_REQUEST['email'], $_REQUEST['name']);
$this->email->to('REMOVED');

$this->email->subject("Website Query");
$this->email->message($_REQUEST['comment']);

$this->email->send();
$this->load->view('contact_sent_view');
}
}
}
?>

I say im not a web developer but I have some understanding of how things work just new to codeigniter I was supprised my friend is using this really I didnt tell him to. it was a case of I'll code the site for you. 3 days later he sends me the site with the codigniter with it I was like oookkk.

but ive read a few artcles online and yes im aware you have to write controllers and stuff but no I havent yet watched the videos etc.

sorry for asking for help god. for future adventures i wont use it if it bothers you that much.[/quote]

My friend you are far to sensitive! Firstly, my intent was *not* to flame you:
[quote author=beatryder]Pardon me if I seem rude, but it seems as though you don’t fully understand how code igniter works?[/quote]

And I did offer you help as well!

Now that that is out of the way...

Lets have a look at what you are doing shall we?

I am assuming that header.php is loaded with a
Code:
$this->load->view('header');
in your *_view files?


Now as I said before, you need to post the contents of all the files you are using. I will work with what you have though.


You are going to have to trace through the code in your implementation to find your problems.

What you can do is something like this:
Code:
function index(){
$data['base_view'] = $this->config->item('base_view');
$this->load->view('index_view',$data);
}

then in your header.php file replace
Code:
<link href="<?=$this->config->item('base_view');?>style.css" rel="stylesheet" type="text/css">

with

Code:
<link href="<?=$base_view?>style.css" rel="stylesheet" type="text/css">

Without knowing what is in header.php and your view files there is not much else I can do to help you.


Messages In This Thread
Fatal error: Using $this when not in object context - by El Forum - 08-12-2007, 03:38 PM
Fatal error: Using $this when not in object context - by El Forum - 08-12-2007, 04:15 PM
Fatal error: Using $this when not in object context - by El Forum - 08-13-2007, 04:04 AM
Fatal error: Using $this when not in object context - by El Forum - 08-13-2007, 10:04 AM
Fatal error: Using $this when not in object context - by El Forum - 08-13-2007, 04:15 PM
Fatal error: Using $this when not in object context - by El Forum - 08-13-2007, 04:49 PM
Fatal error: Using $this when not in object context - by El Forum - 08-13-2007, 04:51 PM
Fatal error: Using $this when not in object context - by El Forum - 08-13-2007, 04:52 PM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 01:39 AM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 03:45 AM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 09:36 AM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 02:01 PM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 02:04 PM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 02:08 PM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 02:22 PM
Fatal error: Using $this when not in object context - by El Forum - 08-14-2007, 03:20 PM
Fatal error: Using $this when not in object context - by El Forum - 08-15-2007, 03:30 PM
Fatal error: Using $this when not in object context - by El Forum - 08-15-2007, 04:12 PM
Fatal error: Using $this when not in object context - by El Forum - 08-16-2007, 02:30 AM
Fatal error: Using $this when not in object context - by El Forum - 08-26-2007, 05:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB