Answer the question
In order to leave comments, you need to log in
Yii2 - How to delete one record?
I upload pictures and output them like this
<? foreach($allPhoto as $ph): ?>
<div class="bg-danger">
<img style="width: 200px;" src="<?= '.$ph['photo']?>" alt=""/>
<span><?= $ph['author'] ?></span>
<span style="float: right"><?= $ph['time'] ?></span>
</div>
<br/>
<? endforeach ;?
Answer the question
In order to leave comments, you need to log in
you make a link to the controller and its action. pass it the ID of the photo. you delete it in the action, you transfer it to the same page from where you came.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question