[php] link generation
Viewer
- //my view file code
- DetailView::widget([
- 'model' => $model,
- 'attributes' => [
- 'name',
- 'project_date:date',
- 'client_name',
- 'project_url:url',
- 'detail:html',
- [
- 'label' => 'Project Images',
- 'format' => ['raw'],
- 'value' => $this->render('_test', ['listData' => $model])
- ]
- ],
- ])
- // my _test.php file code
- $link = Yii::getAlias('@frontend/web/projects_pictures/'.$listData->id);
- $path = \yii\helpers\FileHelper::findFiles($link);
- foreach ($path as $pic){
- echo "<img src='$pic' alt='test' />";
- }
Editor
You can edit this paste and save as new: