Welcome Guest, Not a member yet? Register   Sign In
[Solved] Custom Folder Structures
#2

[eluser]TheFuzzy0ne[/eluser]
Variables can be passed to a view as an array, via the second parameter of $this->load->view(), when you load a view using CodeIgniter's built-in loader. As you are directly including the pages, none of the CI variables exist within the view.

My suggestion would be to either a) extend the output class to your liking, or b), leave the views directory alone and simply create a shortcut to it named "template" for your own personal use. If you have no way to create a shortcut, I would suggest leaving things the way they were. CodeIgniter works great straight out of the box, but that's partly due to it's structure. If you re-organise the structure, you are likely to have a lot of problems.

However, it's possible to get a reference to the CI super object, by using:

Code:
$CI =& get_instance();

Then you could call on your template class like this:

Code:
$CI->template->load('header');


Messages In This Thread
[Solved] Custom Folder Structures - by El Forum - 02-07-2009, 05:24 PM
[Solved] Custom Folder Structures - by El Forum - 02-08-2009, 12:54 PM
[Solved] Custom Folder Structures - by El Forum - 02-08-2009, 08:39 PM
[Solved] Custom Folder Structures - by El Forum - 02-09-2009, 06:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB