Bueno hoy tengo un pequeño problema con un breadcrumb que estoy disque haciendo en mvc pero este me esta cuasando un error:
Call to undefined function breadcrumbs() in C:\wamp\www\sin_mvc\modelo.php on line 59
a continuacion el codigo del modelo.php
Código PHP:
<?php
require_once "conexion.php";
class auth extends database
{
private $data;
private $row;
private $query;
private $querys;
private $home;
private $separador;
private $out;
private $layers;
public function __construct(){
$this->home= "<a href='".$_SERVER['PHP_SELF']."' >Home</a>";
$this->separador = ">>";
}
public function getbread()
{
$this->conectar();
$this->data=array();
$this->query= $this->consulta("SELECT * from menu order by id ASC");
if($this->numero_de_filas($this->query) > 0)
{
while ($this->row = $this->fetch_array($this->query))
$this->data[] = $this->row;
return $this->data;
}
}
function breadcrumbs($id,$layer=0,$out='')
{
if(isset($id))
{
if($id!= '')
{
$catid = $id;
}
if($catid==0)
{
echo $this->home;
}
$this->layers=$layer;
$this->querys = $this->consulta("Select * From menu where id='$catid'");
$miga = $this->fetch_array($this->querys);
if($this->layers==0)
{
$this->out=$miga['nombre'];
}
else
{
$this->out = '<a href="index.php?cat='.$miga['id'].'">'.$miga['nombre'].'</a>'.$this->separador.' '.$this->out.'';
}
$this->layers++;
if($miga['hijo'] > 0)
{
$out = breadcrumbs($miga['hijo'],$this->layers,$this->out);
}
else
{
$this->out = '<a href="index.php?cat='.$id.'">'.$this->out.'</a>';
}
return $this->out;
}
}
}
?>
este es el controlador
Código PHP:
<?php
require_once "modelo.php";
class mvc_bread{
public function index()
{
$datas = new auth;
$menu=$datas->getbread();
require "menu.php";
$catid= isset($_GET['cat'])? $_GET['cat']:0;
$id=$datas->breadcrumbs($catid);
echo $id;
}
}
?>