Skip to content

Repository files navigation

Contao 4 core bundle

Contao is an Open Source PHP Content Management System for people who want a professional website that is easy to maintain. Visit the project website for more information.

Contao 4 has been designed as a Symfony bundle, which can be used to add CMS functionality to any Symfony application. If you do not have an existing Symfony application yet, we recommend using the Contao managed edition as basis for your application.

Installation

Edit your composer.json file and add the following:

"require": {
"contao/core-bundle": "^4.4"
},
"config": {
"component-dir": "assets"
},
"post-install-cmd": [
"Contao\\CoreBundle\\Composer\\ScriptHandler::addDirectories",
"Contao\\CoreBundle\\Composer\\ScriptHandler::generateSymlinks"
],
"post-update-cmd": [
"Contao\\CoreBundle\\Composer\\ScriptHandler::addDirectories",
"Contao\\CoreBundle\\Composer\\ScriptHandler::generateSymlinks"
]

Then run php composer.phar update to install the vendor files.

Activation

Remove the parameters.yml import from your app/config/config.yml file:

imports:
- { resource: parameters.yml } # <-- remove this line
- { resource: security.yml }

Then adjust to your app/AppKernel.php file:

// app/AppKernel.phpclass AppKernel extends Kernel
{
publicfunctionregisterBundles()
{
$bundles = [
// ...newKnp\Bundle\MenuBundle\KnpMenuBundle(),
newKnp\Bundle\TimeBundle\KnpTimeBundle(),
newNelmio\CorsBundle\NelmioCorsBundle(),
newNelmio\SecurityBundle\NelmioSecurityBundle(),
newContao\CoreBundle\ContaoCoreBundle(),
];
}
publicfunctionregisterContainerConfiguration(LoaderInterface$loader)
{
$rootDir = $this->getRootDir();
if (file_exists($rootDir.'/config/parameters.yml')) {
$loader->load($rootDir.'/config/parameters.yml');
}
$loader->load($rootDir.'/config/config_'.$this->getEnvironment().'.yml');
}
}

Configuration

Add the Contao routes to your app/config/routing.yml file:

ContaoCoreBundle:
resource: "@ContaoCoreBundle/Resources/config/routing.yml"

Edit your app/config/security.yml file:

security:
providers:
contao.security.user_provider:
id: contao.security.user_providerfirewalls:
dev:
pattern: ^/(_(profiler|wdt|error)|css|images|js)/security: falseinstall:
pattern: ^/(contao/install|install\.php)security: falsebackend:
request_matcher: contao.routing.backend_matcherstateless: truesimple_preauth:
authenticator: contao.security.authenticatorfrontend:
request_matcher: contao.routing.frontend_matcherstateless: truesimple_preauth:
authenticator: contao.security.authenticator

Edit your app/config/config.yml file and add the following:

# Contao configurationcontao:
# Required parametersprepend_locale: "%prepend_locale%"# Optional parametersweb_dir: "%kernel.project_dir%/web"encryption_key: "%kernel.secret%"url_suffix: .htmlupload_path: filescsrf_token_name: contao_csrf_tokenpretty_error_screens: trueerror_level: 8183# E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATEDimage:
bypass_cache: falsetarget_dir: "%kernel.project_dir%/assets/images"valid_extensions: ['jpg', 'jpeg', 'gif', 'png', 'tif', 'tiff', 'bmp', 'svg', 'svgz']imagine_options:
jpeg_quality: 80interlace: planesecurity:
disable_ip_check: false

You can also overwrite any parameter stored in the localconfig.php file:

# Contao configurationcontao:
localconfig:
adminEmail: foo@bar.comdateFormat: Y-m-d

License

Contao is licensed under the terms of the LGPLv3.

Getting support

Visit the support page to learn about the available support options.

About

Contao 4 core bundle

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages