jeriveromartinez/maintenance-site-bundle

This bundle allows your site in maintenance mode

2.1 2016-06-25 01:59 UTC

This package is not auto-updated.

Last update: 2024-05-25 16:55:58 UTC


README

##This bundle allows your site in maintenance mode for public or anonymous users, allowing you to see changes made if your user is allowed between roles

composer require jeriveromartinez/maintenance-site-bundle

...
new J3rm\MaintenanceSiteBundle\J3rmMaintenanceSiteBundle(),


##configurations parameter
j3rm_maintenance_site:
path_enable: [/admin,/login]
roles_enable_offline: [ROLE_USER,ROLE_ADMIN]
maintenance: true

Or

j3rm_maintenance_site:
path_enable: [/admin,/login]
roles_enable_offline: [ROLE_USER,ROLE_ADMIN]
database_offline: YourBundle:YourEntity:attributeName (the attribute most be a boolean)

  • path_enable - The administration site url which you must include the login page.
  • roles_enable_offline - The roles allowed to see the site in development mode.
  • maintenance - boolean value to enable or not the maintenance mode.
  • database_offline - It is defined where to catch the value for maintenance mode.

####this bundle redirect to offline page, for that add this to routing.yml

app_offline:
resource: "@J3rmMaintenanceSiteBundle/Controller/"
type: annotation

####create a error503.html.twig file into "Resources/TwigBundle/views/Exception/" and add anonymous permission in the firewall