assets
bin
config
migrations
public
src
Controller
Admin
DashboardController.php
PagesCrudController.php
ProjectsCrudController.php
QuotesCrudController.php
UserCrudController.php
.gitignore
FrontendController.php
PagesController.php
ProjectsController.php
SecurityController.php
UserController.php
Entity
Repository
Security
Kernel.php
templates
tools
translations
.env
.gitignore
.php-cs-fixer.cache
.php-cs-fixer.php
README.md
bootstrap.js
composer.json
composer.lock
controllers.json
docker-compose.override.yml
docker-compose.yml
package.json
rector.php
symfony.lock
webpack.config.js
yarn.lock
31 lines
983 B
PHP
31 lines
983 B
PHP
<?php
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Entity\Pages;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\CodeEditorField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
|
|
|
|
class PagesCrudController extends AbstractCrudController
|
|
{
|
|
public static function getEntityFqcn(): string
|
|
{
|
|
return Pages::class;
|
|
}
|
|
|
|
public function configureFields(string $pageName): iterable
|
|
{
|
|
yield IdField::new(propertyName: 'id')
|
|
->onlyOnIndex();
|
|
yield TextField::new(propertyName: 'name');
|
|
yield AssociationField::new(propertyName: 'owner');
|
|
// yield CodeEditorField::new(propertyName: 'content')
|
|
yield TextareaField::new(propertyName: 'content')
|
|
->onlyOnForms();
|
|
}
|
|
}
|