она передается в качестве параметра в myFunc и ...
function myFunc(/* callback */) {
let arr = [1, 2, 3, 4, 5, 6, 7, 8];
let el = document.querySelector('.out-1');
// callback(arr, el);
el.innerHTML = arr.join('-');
}
//function out(arr, el) {
// el.innerHTML = arr.join('-');
//}
// myFunc(out)
myFunc() protected function prepareForValidation()
{
if (!$this->input('role.slug')) {
$updatedInput = $this->collect('role')->merge([
'slug' => Str::slug($this->input('role.name'), '_'),
])->toArray();
$this->merge(['role' => $updatedInput]);
Request::merge(['role' => $updatedInput]);
}
}.element {
/* width: calc(33.3% - 20px); */
width: calc((100% - 20px * 2) / 3);
height: 50px;
background: black;
}.container {
width: 500px;
display: grid;
grid-gap: 20px;
grid-template-columns: repeat(3, 1fr);
border: 1px solid green;
}
.element {
height: 50px;
background: black;
} public function getDate(): ?string
{
return $this->date;
}// Здесь убрать инициализацию, потому что в конструкторе всё равно заполнится
public ?string $date;
// А здесь, наоборот, указать дефолтное значение
public function __construct(int $id, ?string $name = null)
{
$this->id = $id;
$this->name = $name;
} To enable extensions, verify that they are enabled in your .ini files:
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
<div class="block">
<img src="..." onload="this.classList.add('loaded')">
<span>Текст поверх картинки</span>
</div>.block {
position: relative;
}
.block span {
position: absolute;
display: none;
}
.block img.loaded + span {
display: block;
} $array = ['первый', 'второй'];
[$var1, $var2] = $array;
echo $var1; // 'первый'
echo $var2; // 'второй'$array = ['first' => 'первый', 'second' => 'второй'];
['first' => $var1, 'second' => $var2] = $array;
echo $var1; // 'первый'
echo $var2; // 'второй'