const proceedTweets = tweets.map(tweet => ({ ...tweet, extra: 'stuff' }));
class PageController extends Controller
{
public function news()
{
$news = News::where('active', 1)->first();
return view('news', ['news' => $news]);
}
public function contacts()
{
$social = [/* ... */];
return view('contacts', ['social' => $social]);
}
}
$md5_hash = md5_file($_FILES["fail"]["tmp_name"], true);
$stmt = $pdo->prepare('SELECT * FROM download__files WHERE md5hash = :md5hash');
$stmt->execute(['md5hash' => $md5hash]);
$result = $stmt->fetchColumn();
$breakpoints: (
'xs': ('(max-width: 576px)'),
'sm': ('(max-width: 768px)'),
'md': ('(max-width: 992px)'),
'lg': ('(max-width: 1199px)'),
);
@mixin respond-to($breakpoint) {
@if map-has-key($breakpoints, $breakpoint) {
@media #{inspect(map-get($breakpoints, $breakpoint))} {
@content;
}
} @else {
@error 'Не указано значение для `#{$breakpoint}`';
}
}
@include respond-to('md') {
// ...
}
class Popup{
constructor(options) {
this.modal = $(options.modal);
this.overlay = $(options.overlay);
this.overlay.on('click', this.close.bind(this));
}
open(content){
this.modal.html(content);
this.modal.addClass('open');
this.overlay.addClass('open');
}
close(){
this.modal.removeClass('open');
this.overlay.removeClass('');
}
}