akyos/core-bundle is installed and configured first (this bundle depends on it).composer require akyos/cms-bundle
config/bundles.php:
Akyos\CmsBundle\AkyosCmsBundle::class => ['all' => true],
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
/admin (default route) to create your first page or menu.akyos/core-bundle (e.g., php bin/console make:user) and assign the ROLE_ADMIN role.default.html.twig).
Place templates in templates/AkyosCmsBundle/ (e.g., templates/AkyosCmsBundle/page/default.html.twig).{{ page.content }} or custom fields (e.g., {{ page.meta_title }}).
Extend with custom fields via Doctrine entities (see Doctrine Extensions).templates/AkyosCmsBundle/ directory.
Example:
{# templates/AkyosCmsBundle/page/custom.html.twig #}
<h1>{{ page.title }}</h1>
<div>{{ page.content|raw }}</div> {# CKEditor HTML #}
{{ render(akyos_cms_menu('header')) }}
akyos/core-bundle for users. Extend with CMS-specific roles (e.g., ROLE_CMS_EDITOR).karser/recaptcha3-bundle for form protection).friendsofsymfony/ckeditor-bundle).
Access content in Twig as {{ page.content|raw }}.knp-paginator-bundle for paginated lists (e.g., blog posts).
Example controller:
use Knp\Component\Pager\PaginatorInterface;
public function listPages(PaginatorInterface $paginator, Request $request)
{
$pages = $this->getDoctrine()->getRepository(Page::class)->findAll();
return $this->render('page/list.html.twig', [
'pages' => $paginator->paginate($pages, $request->query->getInt('page', 1), 10),
]);
}
akyos.cms.page.save to extend page logic:
// src/EventListener/CmsListener.php
public static function getSubscribedEvents()
{
return [
'akyos.cms.page.save' => 'onPageSave',
];
}
Page entity (located in Akyos\CmsBundle\Entity\Page) by creating a child class and using inheritance mapping.webpack-encore) for CSS/JS. Place files in assets/cms/ and import via:
{{ encore_entry_link_tags('cms-admin') }}
Missing CoreBundle:
Class 'Akyos\CoreBundle\AkyosCoreBundle' not found.akyos/core-bundle first and ensure it’s enabled in bundles.php.Template Overrides Not Working:
templates/AkyosCmsBundle/ are ignored.php bin/console cache:clear
default.html.twig for the default template).CKEditor Configuration:
config/packages/fos_ck_editor.yaml:
fos_ck_editor:
base_path: /bundles/akyosckeditor
config:
default:
toolbar: Full
Doctrine Extensions Conflicts:
beberlei/doctrineextensions and stof/doctrine-extensions-bundle may cause conflicts.stof for Sluggable and Timestampable).Recaptcha3 Validation:
karser_recaptcha3 configuration in .env:
KARSER_RECAPTCHA3_SECRET=your_secret_key
KARSER_RECAPTCHA3_SITE_KEY=your_site_key
/profiler) for errors.ROLE_ADMIN) are assigned correctly.php bin/console doctrine:schema:validate
{{ dump(page) }}
Custom Page Types:
Page entity to add fields (e.g., BlogPost):
// src/Entity/BlogPost.php
#[ORM\Entity]
#[ORM\Table(name: 'akyos_cms_pages')]
#[ORM\InheritanceType("SINGLE_TABLE")]
#[ORM\DiscriminatorColumn(name: "type", type: "string")]
#[ORM\DiscriminatorMap(["page" => Page::class, "blog_post" => BlogPost::class])]
class BlogPost extends Page
{
#[ORM\Column(type: "string", length: 255)]
private string $author;
// Getters/setters...
}
Custom Admin Routes:
# config/routes.yaml
akyos_cms_custom_admin:
resource: "@AkyosCmsBundle/Resources/config/routing/admin.yaml"
prefix: /admin/custom
Custom Fixtures:
doctrine-fixtures-bundle to seed test data:
// src/DataFixtures/CmsFixtures.php
public function load(ObjectManager $manager)
{
$page = new Page();
$page->setTitle('Home');
$page->setContent('<h1>Welcome!</h1>');
$manager->persist($page);
$manager->flush();
}
php bin/console doctrine:fixtures:load
Paginator Bundle:
knp_paginator is configured in config/packages/knp_paginator.yaml:
knp_paginator:
page_range: 5
default_options:
page_name: page
sort_field_name: sort
sort_direction_name: direction
distinct: true
Webpack Encore:
webpack.config.js is linked:
yarn install
yarn build
Mailer Configuration:
symfony/mailer in .env:
MAILER_DSN=smtp://user:pass@smtp.example.com:port
How can I help you explore Laravel packages today?