Welcome Guest, Not a member yet? Register   Sign In
Functions Scopes
#1

[eluser]Anraiki[/eluser]
Hey guys,
I am trying to make a included page inherit the functions of a class in the library, however they are not.

What I am trying to achieve is the ability to organize the system of Code Igniter to my liking:

On the root level of my web host is the following:

- Index.php
- /System/
-- /Application/
-- /Ect/
- /Template/
-- /Default/
--- Index.php
--- Header.php
--- Footer.php

I have created /Template/ on the top level for web designer who do not know any high level of php, it is there for them to design.

As for my I attempt, I have made a Class function to include files in that directory. I have also auto loaded this and the url helper.

So my controller would automatically have one line that loads the view file which had only one line:

<?php $this->template->load('index.php'); //Loads the Default Template Index.php ?>

Now everything is working fine until this point.

In the Default Template index.php:

<?php $this->template->load('header.php'); //Loads the Default Template header.php ?>
~Content~
<?php $this->template->load('footer.php'); //Loads the Default Template footer.php ?>

The page error because the function does not exist (not in that scope), how can I made this included file inherit my class function of template?
#2

[eluser]TheFuzzy0ne[/eluser]
I don't udnerstand why that would happen. I experienced a problem a few weeks ago where something else was triggering the error. If that's the case, and the error page is shown, then the CodeIgniter object will not be available.

Hope this helps.
#3

[eluser]jane0109[/eluser]
Hmmm... Im thinking of another way but when I tried it, IT didn't worked. I tried TheFuzzyOne's suggestionand it worked.




Theme © iAndrew 2016 - Forum software by © MyBB