[eluser]Sebish[/eluser]
I'm having some issues with creating an "if else" statement within a view of my current project, I have searched the forums and the user documention and been able to find suitable information to help me. I have a container that is the main view that all my other views load from depending on the link it is given, and I am trying to make a menu that changes depending on what section of the website you are in. I'm assuming that the easiest way to do this is an "if else" statement, however I cannot seem to get a variable to check it by, I can do this in PHP without a framework very easily, however with code igniter I am seeming to have problems. In essence I want it to check if a controller/model/view are loaded for example customers, and if this is the case it brings up the customers menu, simple (not for me, I'm sure there must be a simple solution to this problem.)
Any help would be great, am I going about this the wrong way? Or is there somehow I can create a check inside a controller or a model that I can reference inside the view. Cheers in advance for any help!
Code:
<? if (something == 'customer'): ?>
<? $this->load->view('layout/navigation/customers'); ?>
<? else: ?>
<? $this->load->view('layout/navigation/general'); ?>
<? endif; ?>