user photo add
This commit is contained in:
@ -32,6 +32,16 @@ $form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", param
|
||||
->setLabel("Email")
|
||||
->render();
|
||||
|
||||
if (!empty($model->user_photo)){
|
||||
echo "<div><img src='$model->user_photo' width='200px'></div>";
|
||||
}
|
||||
$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [
|
||||
'class' => "form-control",
|
||||
'value' => $model->user_photo ?? ''
|
||||
])
|
||||
->setLabel("Фото профиля")
|
||||
->render();
|
||||
|
||||
$entityRelations = new \kernel\EntityRelation();
|
||||
if (!isset($model)) {
|
||||
$model = new User();
|
||||
|
@ -40,6 +40,9 @@ $table->columns([
|
||||
'class' => \Itguild\Tables\Filter\InputTextFilter::class
|
||||
]
|
||||
],
|
||||
'user_photo' => function ($data) {
|
||||
return $data ? "<img src='$data' width='150px'>" : "";
|
||||
},
|
||||
'created_at' => function ($data) {
|
||||
if (!$data){
|
||||
return null;
|
||||
|
@ -35,6 +35,9 @@ foreach ($additionals as $key => $additional) {
|
||||
}
|
||||
|
||||
$table->rows([
|
||||
'user_photo' => function ($data) {
|
||||
return $data ? "<img src='$data' width='300px'>" : "";
|
||||
},
|
||||
'created_at' => function ($data) {
|
||||
if (!$data){
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user