From ced4ccd93bc847e4866abfb61a556a3b4484aa5b Mon Sep 17 00:00:00 2001 From: "Andrey F. Mindubaev" Date: Mon, 18 Jun 2018 23:45:03 +0300 Subject: [PATCH] Add recipe for sonata-project/page-bundle --- .../3.9/config/packages/sonata_page.yaml | 87 ++++++++++++++ .../3.9/config/routes/sonata_page.yaml | 11 ++ sonata-project/page-bundle/3.9/manifest.json | 9 ++ .../3.9/src/Entity/SonataPageBlock.php | 81 +++++++++++++ .../3.9/src/Entity/SonataPagePage.php | 113 ++++++++++++++++++ .../3.9/src/Entity/SonataPageSite.php | 48 ++++++++ .../3.9/src/Entity/SonataPageSnapshot.php | 57 +++++++++ 7 files changed, 406 insertions(+) create mode 100644 sonata-project/page-bundle/3.9/config/packages/sonata_page.yaml create mode 100644 sonata-project/page-bundle/3.9/config/routes/sonata_page.yaml create mode 100644 sonata-project/page-bundle/3.9/manifest.json create mode 100644 sonata-project/page-bundle/3.9/src/Entity/SonataPageBlock.php create mode 100644 sonata-project/page-bundle/3.9/src/Entity/SonataPagePage.php create mode 100644 sonata-project/page-bundle/3.9/src/Entity/SonataPageSite.php create mode 100644 sonata-project/page-bundle/3.9/src/Entity/SonataPageSnapshot.php diff --git a/sonata-project/page-bundle/3.9/config/packages/sonata_page.yaml b/sonata-project/page-bundle/3.9/config/packages/sonata_page.yaml new file mode 100644 index 00000000..f63952aa --- /dev/null +++ b/sonata-project/page-bundle/3.9/config/packages/sonata_page.yaml @@ -0,0 +1,87 @@ +sonata_block: + context_manager: sonata.page.block.context_manager + default_contexts: [sonata_page_bundle] + +sonata_admin: + assets: + extra_javascripts: + - bundles/sonatapage/sonata-page.back.min.js + extra_stylesheets: + - bundles/sonatapage/sonata-page.back.min.css + +sonata_page: + slugify_service: sonata.core.slugify.cocur + multisite: host + use_streamed_response: false + + router_auto_register: + enabled: true + priority: 150 + ignore_route_patterns: + - ^(.*)admin(.*) # ignore admin route, ie route containing 'admin' + - ^_(.*) # ignore symfony routes + ignore_routes: + - sonata_page_cache_esi + - sonata_page_cache_ssi + - sonata_page_js_sync_cache + - sonata_page_js_async_cache + - sonata_cache_esi + - sonata_cache_ssi + - sonata_cache_js_async + - sonata_cache_js_sync + - sonata_cache_apc + ignore_uri_patterns: + - ^/admin\/ # ignore admin route, ie route containing 'admin' + +# page_defaults: +# homepage: # disable decoration for homepage, key - is a page route +# decorate: false +# enabled: true + + default_template: default + templates: + default: + path: '@SonataPage/layout.html.twig' + name: 'default' + containers: + header: + name: Header + content_top: + name: Top content + content: + name: Main content + content_bottom: + name: Bottom content + footer: + name: Footer + matrix: + layout: | + HHHHHHHH + HHHHHHHH + TTTTTTTT + TTTTTTTT + CCCCCCCC + CCCCCCCC + BBBBBBBB + BBBBBBBB + FFFFFFFF + FFFFFFFF + + mapping: + H: header + T: content_top + C: content + B: content_bottom + F: footer + + direct_publication: '%kernel.debug%' + + catch_exceptions: + not_found: [404] # render 404 page with "not_found" key (name generated: _page_internal_error_{key}) + fatal: [500] # so you can use the same page for different http errors or specify specific page for each error + + class: + page: 'App\Entity\SonataPagePage' + snapshot: 'App\Entity\SonataPageSnapshot' + block: 'App\Entity\SonataPageBlock' + site: 'App\Entity\SonataPageSite' diff --git a/sonata-project/page-bundle/3.9/config/routes/sonata_page.yaml b/sonata-project/page-bundle/3.9/config/routes/sonata_page.yaml new file mode 100644 index 00000000..764a52b0 --- /dev/null +++ b/sonata-project/page-bundle/3.9/config/routes/sonata_page.yaml @@ -0,0 +1,11 @@ +#sonata_page_api: +# resource: '@SonataPageBundle/Resources/config/routing/api.xml' +# prefix: / + +#sonata_page_cache: +# resource: '@SonataPageBundle/Resources/config/routing/cache.xml' +# prefix: / + +sonata_page_exceptions: + resource: '@SonataPageBundle/Resources/config/routing/exceptions.xml' + prefix: / diff --git a/sonata-project/page-bundle/3.9/manifest.json b/sonata-project/page-bundle/3.9/manifest.json new file mode 100644 index 00000000..c961fb44 --- /dev/null +++ b/sonata-project/page-bundle/3.9/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "Sonata\\PageBundle\\SonataPageBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "src/": "%SRC_DIR%/" + } +} diff --git a/sonata-project/page-bundle/3.9/src/Entity/SonataPageBlock.php b/sonata-project/page-bundle/3.9/src/Entity/SonataPageBlock.php new file mode 100644 index 00000000..417e8b47 --- /dev/null +++ b/sonata-project/page-bundle/3.9/src/Entity/SonataPageBlock.php @@ -0,0 +1,81 @@ +id; + } + + /** + * @ORM\PrePersist + */ + public function prePersist(): void + { + parent::prePersist(); + } + + /** + * @ORM\PreUpdate + */ + public function preUpdate(): void + { + parent::preUpdate(); + } +} diff --git a/sonata-project/page-bundle/3.9/src/Entity/SonataPagePage.php b/sonata-project/page-bundle/3.9/src/Entity/SonataPagePage.php new file mode 100644 index 00000000..b9f2fbdd --- /dev/null +++ b/sonata-project/page-bundle/3.9/src/Entity/SonataPagePage.php @@ -0,0 +1,113 @@ +id; + } + + /** + * @ORM\PrePersist + */ + public function prePersist(): void + { + parent::prePersist(); + } + + /** + * @ORM\PreUpdate + */ + public function preUpdate(): void + { + parent::preUpdate(); + } +} diff --git a/sonata-project/page-bundle/3.9/src/Entity/SonataPageSite.php b/sonata-project/page-bundle/3.9/src/Entity/SonataPageSite.php new file mode 100644 index 00000000..9d2b688a --- /dev/null +++ b/sonata-project/page-bundle/3.9/src/Entity/SonataPageSite.php @@ -0,0 +1,48 @@ +id; + } + + /** + * @ORM\PrePersist + */ + public function prePersist(): void + { + parent::prePersist(); + } + + /** + * @ORM\PreUpdate + */ + public function preUpdate(): void + { + parent::preUpdate(); + } +} diff --git a/sonata-project/page-bundle/3.9/src/Entity/SonataPageSnapshot.php b/sonata-project/page-bundle/3.9/src/Entity/SonataPageSnapshot.php new file mode 100644 index 00000000..9560a863 --- /dev/null +++ b/sonata-project/page-bundle/3.9/src/Entity/SonataPageSnapshot.php @@ -0,0 +1,57 @@ +id; + } +}