__construct()
{
$js = <<<JAVASCRIPT
<script>
if (‘localStorage’ in window && window[‘localStorage’] !== null) {
function set(key, data) {
localStorage.setItem(key, data);
}
function get(key) {
return localStorage.getItem(key);
}
function remove(key) {
localStorage.removeItem(key);
}
function clear() {
localStorage.clear();
}
}
</script>n
JAVASCRIPT;
echo $js;
}
heredoc
Обсуждают сегодня