angular.module('toster', [])
.controller('GridCtrl', function() {
var vm = this;
var grids = [
{
xs: '12',
sm: '6',
md: '4',
lg: '4'
},
{
xs: '10',
sm: '8',
md: '6',
lg: '3'
}
];
var activeIndex = 0;
vm.activeGrid = grids[activeIndex];
vm.toggleGrid = function() {
switch (activeIndex) {
case 0:
vm.activeGrid = grids[++activeIndex];
break;
case 1:
vm.activeGrid = grids[--activeIndex];
break;
}
};
})
.directive('dynamicGrid', function() {
return {
scope: {
grid: '=dynamicGrid'
},
templateUrl: 'dynamicGrid.html',
link: function(scope, elem) {
scope.$watch('grid', function(grid) {
var gridCss = {};
angular.forEach(grid, function(value, key) {
gridCss['col-' + key + '-' + value] = true;
});
scope.gridCss = gridCss;
});
}
};
});
protected function setUp()
{
parent::setUp();
$this->mockApplication();
}
filename = 7c4f149052dcb80f4c858ca9fa9c162b2a3215d0051a2aeb82d26803481c94365ff8d3b0b23a9af752392bae62e0142791453013d459e9cfa607e39d63c17d3c.jpg
dirname = /uploads/docs/7c/4f/14/7c4f149052dcb80f4c858ca9fa9c162b2a3215d0051a2aeb82d26803481c94365ff8d3b0b23a9af752392bae62e0142791453013d459e9cfa607e39d63c17d3c.jpg
var src = [
{name: 'Vasya'},
{name: 'Zina'},
{name: 'Vasya'},
{name: 'Vasya'},
{name: 'Petya'},
{name: 'Vasya'},
{name: 'Petya'},
{name: 'Vasya'},
];
var temp = {};
var result = [];
src.forEach(function(item) {
var name = item.name;
if (!temp[name]) {
temp[name] = true;
result.push(item);
}
});
console.log(result);
function convert($str) {
$str = mb_convert_encoding($str , 'UTF-32', 'UTF-8'); // Big endian
$t = unpack('N*', $str);
$t = array_map(function($n) { return "&#$n;"; }, $t);
return join('', $t);
}
var_dump(convert('foo bar')); // string(39) "foo bar"