right now I'm working on a site that has 3 main layouts, header, main layout and footer, they are all called by the same controller. The main layout change depending on the request. But header and footer will be always the same. In my header there's a dyinamic breadcrumb that I got from Dominic Barnes in this post.
The problem is that I don't know if I put it on the correct place since I have 2 errors:
Notice: Undefined index: HTTPS Strict Standards: Only variables should be passed by reference in
I put the code from Dominic Barnes in my html like this:
<?php
function breadcrumbs($separator = ' » ', $home = 'Home') {
$path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));
$base = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
$breadcrumbs = Array("<a href=\"$base\">$home</a>");
$last = end(array_keys($path));
foreach ($path AS $x => $crumb) {
$title = ucwords(str_replace(Array('.php', '_'), Array('', ' '), $crumb));
if ($x != $last)
$breadcrumbs[] = "<a href=\"$base$crumb\">$title</a>";
else
$breadcrumbs[] = $title;
}
return implode($separator, $breadcrumbs);
}
?>
<div class="breadcrumb-line breadcrumb-line-wide">
<ul class="breadcrumb">
<li class="active" >
<p><i class="icon-home2 position-left"></i><?= breadcrumbs() ?></p>
</li>
</ul>
</div>
The code from Dominic, is supposed to be on my controller or on my view html?
Sorry if this is a noob question but I'm kinda new on all of this.