added upload
This commit is contained in:
parent
2dfe0070e2
commit
a7dc9bb49b
|
@ -4,6 +4,9 @@ namespace App\Controller\Admin;
|
||||||
|
|
||||||
use App\Entity\Projects;
|
use App\Entity\Projects;
|
||||||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField;
|
||||||
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -15,14 +18,17 @@ class ProjectsCrudController extends AbstractCrudController
|
||||||
return Projects::class;
|
return Projects::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public function configureFields(string $pageName): iterable
|
public function configureFields(string $pageName): iterable
|
||||||
{
|
{
|
||||||
return [
|
yield IdField::new(propertyName: 'id')
|
||||||
IdField::new('id'),
|
->onlyOnIndex();
|
||||||
TextField::new('title'),
|
yield TextField::new(propertyName: 'name');
|
||||||
TextEditorField::new('description'),
|
yield TextField::new(propertyName: 'description');
|
||||||
];
|
yield TextField::new(propertyName: 'description');
|
||||||
|
yield ImageField::new(propertyName: 'teaserImage')
|
||||||
|
->setBasePath(path: 'uploads/projects')
|
||||||
|
->setUploadDir(uploadDirPath: 'public/uploads/projects')
|
||||||
|
->setUploadedFileNamePattern(patternOrCallable: '[timestamp]-[slug].[extension]');
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue