Undefined variable: items
hlinton7 opened this issue ยท 2 comments
hlinton7 commented
Hi,
I am getting an error in my code, it doesn't seem to be passing the variable $items, so when using var_dump the error shows.
I have acorn installed.
Also to note, it seems it isn't registering the Breadcrumb component, as when I echo any text it won't show either.
This is my component file and linking to the correct template file.
<?php
namespace App\View\Components;
use Roots\Acorn\View\Component;
use Log1x\Crumb\Facades\Crumb;
class Breadcrumb extends Component
{
/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* The breadcrumb items.
*
* @return string
*/
public function items()
{
return Crumb::build()->toArray();
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return $this->view('components.breadcrumb');
}
}