cerebrate/templates/element/genericElements/IndexTable/Fields/role.php

23 lines
554 B
PHP
Raw Normal View History

<?php
$roles = $this->Hash->extract($row, $field['data_path']);
if (!empty($roles)) {
if (!isset($roles[0])) {
$roles = array($roles);
}
$count = count($roles);
$i = 0;
foreach ($roles as $role) {
$i++;
echo sprintf(
'<a href="%sroles/view/%s">%s</a>',
$baseurl,
h($role['id']),
h($role['name'])
);
if ($i < $count) {
echo '<br />';
}
}
}
?>