English spoken conference

Configuration Reference

1.3 version
Maintained Unmaintained
1.2

Configuration Reference

The ContentBundle can be configured under the cmf_content key in your application configuration. When using XML, you can use the http://cmf.symfony.com/schema/dic/content namespace.

Configuration

default_template

type: string default: null

This defines the template to use when rendering the content if the routing does not specify the template. {_format} and {_locale} are replaced with the request format and the current locale.

persistence

This defines the persistence driver. The default configuration of persistence is the following configuration:

  • YAML
    1
    2
    3
    4
    5
    6
    7
    # app/config/config.yml
    cmf_content:
        persistence:
            phpcr:
                enabled:          false
                content_basepath: /cms/content
                manager_name: null
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    <!-- app/config/config.xml -->
    <?xml version="1.0" charset="UTF-8" ?>
    <container xmlns="http://symfony.com/schema/dic/services">
    
        <config xmlns="http://cmf.symfony.com/schema/dic/content">
            <persistence>
                <phpcr
                    enabled="false"
                    content-basepath="/cms/content"
                    manager-name="null"
                />
            </persistence>
        </config>
    
    </container>
    
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    // app/config/config.php
    $container->loadFromExtension('cmf_content', [
        'persistence' => [
            'phpcr' => [
                'enabled'          => false,
                'content_basepath' => '/cms/content',
                'manager_name'     => null,
            ],
        ],
    ]);
    

enabled

type: boolean default: false

If true, PHPCR is enabled in the service container.

If the CoreBundle is registered, this will default to the value of cmf_core.persistence.phpcr.enabled.

PHPCR can be enabled by multiple ways such as:

  • YAML
    1
    2
    3
    4
    5
    6
    phpcr: ~ # use default configuration
    # or
    phpcr: true # straight way
    # or
    phpcr:
        manager: ... # or any other option under 'phpcr'
    
  • XML
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    <persistence>
        <!-- use default configuration -->
        <phpcr />
    
        <!-- or setting it the straight way -->
        <phpcr>true</phpcr>
    
        <!-- or setting an option under 'phpcr' -->
        <phpcr manager="..." />
    </persistence>
    
  • PHP
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    $container->loadFromExtension(..., array( // bundle configuration key, e.g. cmf_menu
        // ...
        'persistence' => array(
            'phpcr' => null, // use default configuration
            // or
            'phpcr' => true, // straight way
            // or
            'phpcr' => array(
                'manager' => '...', // or any other option under 'phpcr'
            ),
        ),
    ));
    

content_basepath

type: string default: /cms/content

The basepath for content documents in the PHPCR tree.

manager_name

type: string default: null

The document manager that holds StaticContent documents. If not set, the default manager is used.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.