<?php foreach ($все_доступные as $p_m) : ?>
<?php
$cheked = '';
foreach ($все_чекнутые as $p_m_s) {
if($p_m_s['id'] == $p_m['id']) {
$cheked = 'checked';
break;
}
}
?>
<input type="checkbox" name="payment_method[]" value="<?php echo $p_m['id']; ?>" <?php echo $cheked;?> /><?php echo $p_m['name']; ?><br>
<?php endforeach; ?>
<code>
andrApp.controller('tabsMenu', ['$scope',
function tabsMenu($scope) {
$scope.setTab = function(id) {
$scope.tab = id;
for(item in $scope.settingsMenu) {
item.active = (item.id === tab) ? 'active' : '';
}
}
$scope.tab = 0;
$scope.settingsMenu = [
{
id: 0,
active:'active',
name: 'Фотоальбом',
desc: 'Загрузить/Удалить'
},
{
id: 1,
active:'',
name: 'Я',
desc: 'Основные настройки'
},
{
id: 2,
active:'',
name: 'Я путешественник',
desc: 'Настройка путешествий'
},
];
}]);
<li ng-repeat="item in settingsMenu" ng-class="{item.active}"
ng-click="setTab(item.id)">
<p>{{item.name}}</p>
<p ng-show="{item.active.length > 0}">{{ item.desc }}</p>
</li>