|
@@ -4,6 +4,7 @@ namespace App\Form;
|
|
|
|
|
|
use App\Entity\Article;
|
|
|
use App\Entity\User;
|
|
|
+use App\Service\BaseUrl;
|
|
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
@@ -14,6 +15,11 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
|
|
|
|
class ArticleType extends AbstractType
|
|
|
{
|
|
|
+ public function __construct(protected BaseUrl $baseUrl)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
|
|
{
|
|
|
$builder
|
|
@@ -24,14 +30,16 @@ class ArticleType extends AbstractType
|
|
|
])
|
|
|
->add('slug', TextType::class, [
|
|
|
'attr' => [
|
|
|
- 'readonly' => true,
|
|
|
- 'data-slugger-target' => 'slug'
|
|
|
+ //'readonly' => true,
|
|
|
+ 'data-slugger-target' => 'slug',
|
|
|
+ 'data-url' => $this->baseUrl->getBasePath()
|
|
|
],
|
|
|
])
|
|
|
->add('content', TextareaType::class, [
|
|
|
'required' => false,
|
|
|
'attr' => [
|
|
|
'data-controller' => 'easymde',
|
|
|
+ 'data-url' => $this->baseUrl->getBasePath()
|
|
|
]
|
|
|
])
|
|
|
->add('publicationDate', null, [
|