diff --git a/.travis.yml b/.travis.yml index 8f40564e..c767a9d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,6 @@ cache: - $HOME/.cache/pip - _build -install: pip install sphinx~=1.3 git+https://github.com/fabpot/sphinx-php.git +install: pip install sphinx~=1.3.0 git+https://github.com/fabpot/sphinx-php.git script: sphinx-build -nW -b html -d _build/doctrees . _build/html diff --git a/bundles/blog.rst b/bundles/blog.rst deleted file mode 100644 index 8213d945..00000000 --- a/bundles/blog.rst +++ /dev/null @@ -1,329 +0,0 @@ -.. index:: - single: Blog; Bundles - single: BlogBundle - -BlogBundle -========== - -.. include:: _outdate-caution.rst.inc - -.. include:: _not-stable-caution.rst.inc - -This bundle aims to provide everything you need to create a full blog or -blog-like system. It also includes in-built support for the Sonata Admin -bundle to help you get up-and-running quickly. - -Current features: - -* Host multiple blogs within a single website; -* Place blogs anywhere within your route hierarchy; -* Sonata Admin integration. - -Pending features: - -* Full tag support; -* Frontend pagination (using knp-paginator); -* RSS/ATOM feed; -* Comments; -* User support (FOSUserBundle). - -Notes on this document ----------------------- - -* The XML configuration examples may be formatted incorrectly. - -Dependencies ------------- - -* :doc:`CmfRoutingBundle ` is used to manage the routing; -* :doc:`CmfRoutingAutoBundle ` is used to manage automatically generate routes; -* :doc:`PHPCR-ODM ` is used to persist the bundles documents. - -Configuration -------------- - -Example: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config.yml - cmf_blog: - use_sonata_admin: auto - blog_basepath: /cms/blog - class: - blog_admin: Symfony\Cmf\Bundle\BlogBundle\Admin\BlogAdmin # Optional - post_admin: Symfony\Cmf\Bundle\BlogBundle\Admin\PostAdmin # Optional - blog: Symfony\Cmf\Bundle\BlogBundle\Document\Blog # Optional - post: Symfony\Cmf\Bundle\BlogBundle\Document\Post # Optional - - .. code-block:: xml - - - - - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('cmf_blog', array( - 'use_sonata_admin' => 'auto', - 'blog_basepath' => '/cms/blog', - 'class' => array( - 'blog_admin' => 'Symfony\Cmf\Bundle\BlogBundle\Admin\BlogAdmin', // optional - 'post_admin' => 'Symfony\Cmf\Bundle\BlogBundle\Admin\PostAdmin', // optional - 'blog' => 'Symfony\Cmf\Bundle\BlogBundle\Document\Blog', // optional - 'post' => 'Symfony\Cmf\Bundle\BlogBundle\Document\Post', // optional - ), - )); - -Explanation: - -* **use_sonata_admin** - Specify whether to attempt to integrate with sonata admin; -* **blog_basepath** - *required* Specify the path where the blog content should be placed when using sonata admin; -* **class** - Allows you to specify custom classes for sonata admin and documents; - * **blog_admin**: FQN of the sonata admin class to use for managing ``Blog``'s; - * **post_admin**: FQN of the sonata admin class to use for managing ``Post``'s; - * **blog**: FQN of the document class that sonata admin will use for ``Blog``'s; - * **post**: FQN of the document class that sonata admin will use for ``Post``'s. - -.. note:: - - If you change the default documents **it is necessary** to update the auto - routing configuration, as the auto routing system will not recognize your new - classes and consequently will not generate any routes. - -Auto Routing -~~~~~~~~~~~~ - -The blog bundle uses the ``CmfRoutingAuto`` bundle to generate a route -for each content. You will need an auto routing configuration for this to work. - -You can include the default in the main configuration file as follows: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - imports: - # ... - - { resource: '@CmfBlogBundle/Resources/config/routing/autoroute_default.yml' } - # ... - - .. code-block:: xml - - - - - - - - - .. code-block:: php - - // app/config/config.php - $loader->import('config.php'); - // ... - -The default configuration will produce URLs like the following:: - - http://www.example.com/blogs/dtls-blog/2013-04-14/this-is-my-post - -Refer to the :doc:`RoutingAutoBundle ` documentation -for more information. - -Content Routing -~~~~~~~~~~~~~~~ - -To enable the routing system to automatically forward requests to the blog -controller when a ``Blog`` or ``Post`` content is associated with a route, -add the following under the ``controllers_by_class`` section of -``cmf_routing_extra`` in the main configuration file: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - cmf_routing_extra: - # ... - dynamic: - # ... - controllers_by_class: - # ... - Symfony\Cmf\Bundle\BlogBundle\Document\Blog: cmf_blog.blog_controller:listAction - Symfony\Cmf\Bundle\BlogBundle\Document\Post: cmf_blog.blog_controller:viewPostAction - - .. code-block:: xml - - - - - - cmf_blog.blog_controller:listAction" - - - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('cmf_routing_extra', array( - // ... - 'dynamic' => array( - 'controllers_by_class' => array( - 'Symfony\Cmf\Bundle\BlogBundle\Document\Blog' => 'cmf_blog.blog_controller:listAction', - 'Symfony\Cmf\Bundle\BlogBundle\Document\Post' => 'cmf_blog.blog_controller:viewPostAction', - ), - ), - )); - -Sonata Admin -~~~~~~~~~~~~ - -The ``BlogBundle`` has admin services defined for Sonata Admin, to make the -blog system visible on your dashboard, add the following to the -``sonata_admin`` section: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - sonata_admin: - # ... - dashboard: - groups: - # ... - blog: - label: blog - items: - - cmf_blog.admin - - cmf_post.admin - - .. code-block:: xml - - - - - - - - cmf_blog.admin - cmf_post.admin - - - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('sonata_admin', array( - // ... - 'dashboard' => array( - 'groups' => array( - // ... - 'blog' => array( - 'label' => 'blog', - 'items' => array( - 'cmf_blog.admin', - 'cmf_post.admin', - ), - ), - ), - ), - )); - -Tree Browser Bundle -~~~~~~~~~~~~~~~~~~~ - -If you use the Symfony CMF Tree Browser bundle you can expose the blog routes -to enable blog edition from the tree browser. Expose the routes in the -``fos_js_routing`` section of the configuration file: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - fos_js_routing: - routes_to_expose: - # ... - - admin_bundle_blog_blog_create - - admin_bundle_blog_blog_delete - - admin_bundle_blog_blog_edit - - .. code-block:: xml - - - - - admin_bundle_blog_blog_create - admin_bundle_blog_blog_delete - admin_bundle_blog_blog_edit - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('fos_js_routing', array( - 'routes_to_expose' => array( - // ... - 'admin_bundle_blog_blog_create', - 'admin_bundle_blog_blog_delete', - 'admin_bundle_blog_blog_edit', - ))); - -Integration ------------ - -Templating -~~~~~~~~~~ - -The default templates are marked up for `Twitter Bootstrap`_. But it is easy -to completely customize the templates by **overriding** them. - -The one template you will have to override is the default layout, you will -need to change it and make it extend your applications layout. The easiest way -to do this is to create the following file: - -.. configuration-block:: - - .. code-block:: jinja - - {# app/Resources/CmfBlogBundle/views/default_layout.html.twig #} - {% extends "MyApplicationBundle::my_layout.html.twig" %} - - {% block content %} - {% endblock %} - - .. code-block:: php - - - extend('MyApplicationBundle::my_layout.html.twig') ?> - - output('content') ?> - -The blog will now use ``MyApplicationBundle::my_layout.html.twig`` instead of -``CmfBlogBundle::default_layout.html.twig``. - -See `Overriding Bundle Templates`_ in the Symfony documentation for more -information. - -.. _`controllers as services`: http://symfony.com/doc/current/cookbook/controller/service.html -.. _`Twitter Bootstrap`: http://twitter.github.com/bootstrap/ -.. _`Overriding Bundle Templates`: http://symfony.com/doc/current/book/templating.html#overriding-bundle-templates diff --git a/bundles/content/introduction.rst b/bundles/content/introduction.rst index 35dd526d..07cae398 100644 --- a/bundles/content/introduction.rst +++ b/bundles/content/introduction.rst @@ -79,7 +79,7 @@ For instance, a very simple template looks like: .. code-block:: html+jinja - {# src/Acme/BlogBundle/Resources/views/Post/index.html.twig #} + {# src/AppBundle/Resources/views/Post/index.html.twig #} {% extends '::layout.html.twig' %} {% block title -%} @@ -94,7 +94,7 @@ For instance, a very simple template looks like: .. code-block:: html+php - + extend('::layout.html.twig') ?> set('title', $cmfMainContent->getTitle()) ?> @@ -120,7 +120,7 @@ To configure a default template, use the ``default_template`` option: # ... cmf_content: - default_template: AcmeBlogBundle:Content:static.html.twig + default_template: AppBundle:Content:static.html.twig .. code-block:: xml @@ -131,7 +131,7 @@ To configure a default template, use the ``default_template`` option: @@ -141,7 +141,7 @@ To configure a default template, use the ``default_template`` option: // ... $container->loadFromExtension('cmf_content', array( - 'default_template' => 'AcmeMainBundle:Content:static.html.twig', + 'default_template' => 'AppBundle:Content:static.html.twig', )); Whenever the content controller gets called without a specified template, it diff --git a/bundles/core/publish_workflow.rst b/bundles/core/publish_workflow.rst index dcdb56e8..5ce56615 100644 --- a/bundles/core/publish_workflow.rst +++ b/bundles/core/publish_workflow.rst @@ -193,7 +193,7 @@ desired. Below is an example publish workflow implementation:: - namespace Acme\BlogBundle\Document; + namespace AppBundle\Document; use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishableInterface; use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishTimePeriodInterface; @@ -298,15 +298,15 @@ and define a service with the tag ``cmf_published_voter``. This is similar to the ``security.voter`` tag, but adds your voter to the publish workflow. As with the security voters, you can specify a priority, though it is of limited use as the access decision must be unanimous. If you have more expensive checks, -you can lower the priority of those voters. +you can lower the priority of those voters: .. configuration-block:: .. code-block:: yaml services: - acme.security.publishable_voter: - class: "%my_namespace.security.publishable_voter.class%" + security.publishable_voter: + class: "AppBundle\Security\PublishableVoter" tags: - { name: cmf_published_voter, priority: 30 } @@ -314,8 +314,8 @@ you can lower the priority of those voters. - + @@ -327,8 +327,8 @@ you can lower the priority of those voters. $container ->register( - 'acme.security.publishable_voter', - '%acme.security.publishable_voter.class%' + 'security.publishable_voter', + 'AppBundle\Security\PublishableVoter' ) ->addTag('cmf_published_voter', array('priority' => 30)) ; diff --git a/bundles/index.rst b/bundles/index.rst index bca08a8e..559b9920 100644 --- a/bundles/index.rst +++ b/bundles/index.rst @@ -5,7 +5,6 @@ Bundles :hidden: block/index - blog content/index core/index create/index diff --git a/bundles/map.rst.inc b/bundles/map.rst.inc index f6cbc253..973f5256 100644 --- a/bundles/map.rst.inc +++ b/bundles/map.rst.inc @@ -86,10 +86,6 @@ show a different way of implementing a concept. You can use these bundles in your project, but you can also get ideas from these bundles to create your own bundle based on the key bundles. -* **BlogBundle** (work in progress) - - * :doc:`blog` - * :doc:`content/index` * :doc:`content/introduction` diff --git a/bundles/phpcr_odm/forms.rst b/bundles/phpcr_odm/forms.rst index 67a657cd..4a1d1f66 100644 --- a/bundles/phpcr_odm/forms.rst +++ b/bundles/phpcr_odm/forms.rst @@ -44,7 +44,7 @@ A simple example of using the ``phpcr_document`` form type looks as follows:: 'phpcr_document', array( 'property' => 'title', - 'class' => 'Acme\DemoBundle\Document\TargetClass', + 'class' => 'AppBundle\Document\TargetClass', 'multiple' => true, ) ) @@ -123,14 +123,14 @@ correct. .. code-block:: yaml - # src/Acme/BlogBundle/Resources/config/validation.yml - Acme\BlogBundle\Entity\Author: + # src/AppBundle/Resources/config/validation.yml + AppBundle\Entity\Author: constraints: - Doctrine\Bundle\PHPCRBundle\Validator\Constraints\ValidPhpcrOdm .. code-block:: php-annotations - // src/Acme/BlogBundle/Entity/Author.php + // src/AppBundle/Entity/Author.php // ... use Doctrine\Bundle\PHPCRBundle\Validator\Constraints as OdmAssert; @@ -160,7 +160,7 @@ correct. .. code-block:: php - // src/Acme/BlogBundle/Entity/Author.php + // src/AppBundle/Entity/Author.php // ... use Symfony\Component\Validator\Mapping\ClassMetadata; diff --git a/bundles/seo/extractors.rst b/bundles/seo/extractors.rst index 770d60fa..b3f3b356 100644 --- a/bundles/seo/extractors.rst +++ b/bundles/seo/extractors.rst @@ -43,8 +43,8 @@ Assume you have an ``Article`` object and you want to use both the ``$title`` and ``$date`` properties as page title and the ``$intro`` property as description, you can implement both interfaces and your result will be:: - // src/Acme/BlogBundle/Document/Article.php - namespace Acme\BlogBundle\Document; + // src/AppBundle/Document/Article.php + namespace AppBundle\Document; use Symfony\Cmf\Bundle\SeoBundle\Extractor\TitleReadInterface; use Symfony\Cmf\Bundle\SeoBundle\Extractor\DescriptionReadInterface; @@ -89,12 +89,9 @@ create a class which implements the ``SeoExtractorInterface`` and tag it with .. code-block:: yaml - parameters: - acme_demo.extractor.custom.class: Acme\DemoBundle\Extractor\MyCustomExtractor - services: - acme_demo.extractor.custom: - class: "%acme_demo.extractor.custom.class%" + extractor.custom: + class: "AppBundle\Extractor\MyCustomExtractor" tags: - { name: cmf_seo.extractor } @@ -104,12 +101,8 @@ create a class which implements the ``SeoExtractorInterface`` and tag it with - - Acme\DemoBundle\Extractor\MyCustomExtractor - - - + @@ -117,11 +110,6 @@ create a class which implements the ``SeoExtractorInterface`` and tag it with .. code-block:: php - $container->addParameter( - 'acme_demo.extractor.custom.class', - 'Acme\DemoBundle\Extractor\MyCustomExtractor' - ); - - $container->register('acme_demo.extractor.custom', '%acme_demo.extractor.custom.class%') + $container->register('extractor.custom', 'AppBundle\Extractor\MyCustomExtractor') ->addTag('cmf_seo.extractor') ;