07-25-2007, 12:21 AM
[eluser]eedfwChris[/eluser]
Hey everyone! I am trying to migrate to using the template parser for various reasons but I haven't quite gathered how to make this work how I like it...
Basically what I have is a shell (parent_view.php) which other views are called "in to" such as a login form or body for a specific element. What I am trying to duplicate is the navigation "selection" via css classes.
My assumption is that when you start using the parser that all php code be out of your views. Does anyone have any ideas on how to replicate (attractively) what I am doing with the if statements and css classes as listed below without putting the php into the view while still giving the designer some control over the style of the navigation (ie: not hard coding it into the controller)?
Hey everyone! I am trying to migrate to using the template parser for various reasons but I haven't quite gathered how to make this work how I like it...
Basically what I have is a shell (parent_view.php) which other views are called "in to" such as a login form or body for a specific element. What I am trying to duplicate is the navigation "selection" via css classes.
My assumption is that when you start using the parser that all php code be out of your views. Does anyone have any ideas on how to replicate (attractively) what I am doing with the if statements and css classes as listed below without putting the php into the view while still giving the designer some control over the style of the navigation (ie: not hard coding it into the controller)?
Code:
<!-- Sliding Login Form -->
{sliding_login_form}
<!-- End Sliding Login Form -->
<!-- Start Navigation -->
<ul>
<li <?php if ($uri == 'about_us') { echo 'class="selected"'; } ?>><a href="<?php echo site_url('/about_us/'); ?>">About Us</a></li>
<li <?php if ($uri == 'scheduler') { echo 'class="selected"'; } ?>><a href="<?php echo site_url('/scheduler/'); ?>" class="important">Schedule Appointment</a></li>
<li <?php if ($uri == 'services') { echo 'class="selected"'; } ?>><a href="<?php echo site_url('/services/'); ?>">Services</a></li>
<li <?php if ($uri == 'careers') { echo 'class="selected"'; } ?>><a href="<?php echo site_url('/careers/'); ?>">Careers</a></li>
<li <?php if ($uri == 'contact_us') { echo 'class="selected"'; } ?>><a href="<?php echo site_url('/contact_us/'); ?>">Contact Us</a></li>
</ul>
<!-- End Navigation -->
<!-- Start Body -->
{body}
<!-- End Body -->