artabro/site/templates/layout/func.php

33 lines
705 B
PHP

<?php namespace ProcessWire;
function renderMigas($paxina)
{
$saida = '';
$saida .= '<h1>';
if($paxina->parents->count())
{
$saida .= $paxina->parents->implode(" &gt; ", "<a href='{url}'>{title}</a>",
array(
'append' => '&gt'
)
);
}
$saida .= $paxina->title . '</h1>';
return $saida;
}
function renderMenu($menu, $paxinas)
{
$saida = '';
$saida .= $paxinas->implode("\n", "<li><a href=\"{url}\">{title}</a></li>",
array(
'prepend' => '<nav id="' . $menu . '">' . "\n" . '<ul>' . "\n",
'append' => "\n" . '</ul>' . "\n" . '</nav>' . "\n"
)
);
return $saida;
}