Welcome Guest, Not a member yet? Register   Sign In
Way to go about a simple header
#1

[eluser]dehumanizer[/eluser]
Hello there,

I discovered CI some weeks ago and have been spellbound since, this is very cool really.

I would like to ask the way to go about a common header where I have the company logo, primary navigation, sign in and sign up links.

Suppose I need to have the logo and meta-tags according to the domain name, display additional links if the user is logged as admin or not, etc.

Since I can't load the Header controller inside other controllers what I can understand is that I would build the header with a pre_controller hook, there I can have all the queries and conditional logic to parse the header.

I also tested the MX HMVC, after installation I tried this example and worked:

Code:
<?php echo modules::run('header'); ?>
<p>&lt;?php echo $body; ?&gt;</p>
&lt;?php echo modules::run('footer'); ?&gt;

Seems very good, but I'm really not sure if this is coming along for CI 2.5, 3, 4, etc.

I appreciate any help.


Messages In This Thread
Way to go about a simple header - by El Forum - 04-19-2012, 07:34 AM
Way to go about a simple header - by El Forum - 04-19-2012, 08:35 AM
Way to go about a simple header - by El Forum - 04-19-2012, 08:54 AM
Way to go about a simple header - by El Forum - 04-19-2012, 09:14 AM
Way to go about a simple header - by El Forum - 04-19-2012, 09:23 AM
Way to go about a simple header - by El Forum - 04-19-2012, 09:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB