<?php
class Catalog extends Table {
private $type;
private $desc;
protected $prot;
public $pub;
protected function getMetods() {
$vars = get_object_vars($this->self);
return array_keys($vars);
}
}
abstract class Table {
public $perPub;
protected $perProt;
private $perPriv;
protected $self;
abstract protected function getMetods();
public function __toString() {
return implode(', ', $this->getMetods());
}
}
$o=new Catalog();
echo (string) $o;
<input type="file" onchange="setPhoto(this)" />
function setPhoto(elem) {
var fd = new FormData;
fd.append('file', $(elem).prop('files')[0]);
$.ajax({
url: "урл на пхп обработчик",
data: fd,
processData: false,
contentType: false,
type: 'POST',
success: function (a) {
$('.container-photo img').attr('src', a.data.photo);
}
});
}
npm i -g bower
npm cache clean
npm update -g
<ul>
<li data-sort="2">Суп</li>
<li data-sort="1">Салат</li>
<li data-sort="5">Сок</li>
<li data-sort="4">Плов</li>
<li data-sort="3">Банан</li>
</ul>
var $wrapper = $('ul');
$wrapper.find('li').sort(function (a, b) {
return +a.dataset.sort - +b.dataset.sort;
})
.appendTo( $wrapper );