class Element
{
private ?int $zone = null;
public function __construct(SimpleXMLElement $xml)
{
$this->zone = (string) $xml->xpath('/element[1]/@zone') ?: null;
}
}
у меня есть только таки аннотации
те я никак не могу влезть ПЕРЕД десериализация и заменить "" на nil
но у меня таких полей куча и не хочется лапши из ifов
@Accessor(getter="getZone",setter="setZone")
или @PreSerialize*("метод")
и преобразовывай zone="" в zone="nil". link: <https://apriori-barnaul.ru/wp-json/>; rel="https://api.w.org/", <https://apriori-barnaul.ru/wp-json/wp/v2/pages/10270>; rel="alternate"; type="application/json", <https://apriori-barnaul.ru/?p=10270>; rel="shortlink"
Link: <https://apriori-barnaul.ru/banketnyj-zal/>; rel="canonical", <https://apriori-barnaul.ru/wp-json/wp/v2/pages/10270>; rel="alternate"; type="application/json", <https://apriori-barnaul.ru/?p=10270>; rel="shortlink"
У меня не реактивный фронт,
А грузить всю навигацию по аяксу как-то неправильным кажется.
// сгенерированный объект
const menuItems = [
{url: '/', title: 'Home', items: []},
{url: '/foo/', title: 'Foo', items: [{url: '/foo/bar/', title: 'Bar', items: []}]}
];
// добавляем пункты меню
function renderMenu(parentElement, items)
{
for (let item of items) {
const itemElement = document.createElement('a');
itemElement.href = item.url;
itemElement.innerHTML = title;
parentElement.append(itemElement);
if (item.items.length > 0) {
const menuElement = document.createElement('div');
menuElement.className = 'submenu';
parentElement.append(menuElement);
renderMenu(menuElement, item.items);
}
}
}
document.addEventListener(
'DOMContentLoaded',
() => {
if ((window.screen.availWidth || window.screen.width) <= 800) {
// добавляем компактное меню
renderMenu(document.getElementById('#mobile-menu'), menuItems);
} else {
// добавляем стандартное меню
renderMenu(document.getElementById('#menu'), menuItems);
}
}
);
Очищайте массив $_SESSION вместо удаления данных сессии.
что делать не знаю
axios.defaults.crossDomain = true;
axios.defaults.withCredentials = true;
например, чтобы в Ваше отсутствие я мог исправить найденные ошибки или добавить документацию
ну так если 5-10% написано мной, то как может не быть понимания?