Sunday, May 24, 2015

Help with Breadcrumbs


Hi! friends i am  from Costa Rica and need some help with the breadcrumbs

This is the problem im trying to generate the breadcrumbs with this code in my view:


<?php foreach ($category as $cat): ?>


 <?php $this->Html->addCrumb('Categorias', array('controller' => 'categories', 'action' => 'index'));?>
 <?php $this->Html->addCrumb($cat['name'], array('controller' => 'categories', 'action' => 'view',$cat['id']));?>



<?php
    echo $this->Html->getCrumbs(' ► ', array(
    'text'=>'Inicio',
    'url' => array('controller' => 'anuncios', 'action' => 'index'),
    'escape' => false));
?>
<?php endforeach ?>



but jump a Notice:

InicioCategoriasJuguetes <<< Well formed breadcrumb
Notice (8): Undefined index: name [APP\View\Categories\view.ctp, line 276]
Notice (8): Undefined index: id [APP\View\Categories\view.ctp, line 276]
InicioCategoriasJuguetesCategorias<<< Bad formed breadcrumb

If you can help me with this error.

Thanks in advance!!!


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: