<?php $module_action = $sf_request->getParameter('module') . '_' . $sf_request->getParameter('action');
$link_main = '<a href="' . url_for('@homepage') . '">' . __('Главная') . '</a>';

if($module_action == 'article_show') {
    echo '<div class="breadcrumbs">'. $link_main . link_to(__('Читать'), '@article') .'</div>';

} elseif($module_action == 'catalog_show') {
    echo '<div class="breadcrumbs">'. $link_main . link_to(__('Каталог'), '@catalog');
    if (isset($namesCats) && count($namesCats) > 0) {
        foreach ($namesCats as $key => $cat){
            echo link_to($cat['title'], '@catalog_show?alias=' . $cat['alias']);
        }
    }
    echo '</div>';

} elseif($module_action == 'product_show') {
    echo '<div class="breadcrumbs">'. $link_main . link_to(__('Каталог'), '@catalog');
    if(isset($namesCats) && count($namesCats) > 0){
        foreach ($namesCats as $key => $cat){
            echo link_to($cat['title'], '@catalog_show?alias=' . $cat['alias']);
        }
    }
    echo '</div>';
} ?>