Welcome Guest, Not a member yet? Register   Sign In
Extra characters / whitespace when loading view into variable
#1

[eluser]Unknown[/eluser]
I'm trying to process a menu in the controller as follows:
Code:
/**
  * Renders the html output for the navigation items
  */
function _render_nav_items($current, $base_url) {

  $nav_items  = '';
  foreach($this->_get_nav_items() as $nav_item) {
   $nav_items .= $this->load->view(
    'admin/nav/nav_item',
    array(
     'nav_item' => $nav_item,
     'base_url' => $base_url
    ),
    true
   );
  }
  
  return $nav_items;
}

nav_item.php :
Code:
<li><a href="&lt;?=$base_url.$nav_item['controller']?&gt;">&lt;?=$nav_item['name']?&gt;</a></li>

But in the output I get the following output:
http://i.imgur.com/YMJ5kYU.png?2

Any ideas of why that is, I've tried running trim and compress on the output but I can't get those extra characters/whitespace removed from the output.




Theme © iAndrew 2016 - Forum software by © MyBB