tinternet.net/src/Page/SimplePage.php

71 lines
1.5 KiB
PHP
Raw Normal View History

2021-03-18 21:40:28 +01:00
<?php
namespace App\Page;
use App\Entity\Site\Page\Block;
use App\Entity\Site\Page\Page;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use App\Form\Site\Page\TextareaBlockType;
use App\Form\Site\Page\TextBlockType;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class SimplePage extends Page
{
public function buildForm(FormBuilderInterface $builder)
{
$builder->add(
'title',
TextBlockType::class,
[
'label' => 'Titre',
'required' => true,
'attr' => [
],
'constraints' => [
],
]
);
$builder->add(
'content',
TextareaBlockType::class,
[
'label' => 'Content',
'options' => [
'attr' => [
'data-tinymce' => '',
'rows' => '18',
],
'constraints' => [
],
]
]
);
}
public function setTitle(Block $block)
{
return $this->setBlock($block);
}
public function getTitle()
{
return $this->getBlock('title');
}
public function setContent(Block $block)
{
return $this->setBlock($block);
}
public function getContent()
{
return $this->getBlock('content');
}
}