northernco/maintenance-mode-bundle

本包最新版本(1.3.2)没有提供许可信息。

Symfony 包,用于启用和禁用维护模式

1.3.2 2023-06-15 16:47 UTC

This package is auto-updated.

Last update: 2024-09-15 20:21:53 UTC


README

安装

确保全局已安装 Composer,具体请参考 Composer 文档中的安装章节

使用 Symfony Flex 的应用程序

打开命令行,进入项目目录并执行

$ composer require northernco/maintenance-mode-bundle

未使用 Symfony Flex 的应用程序

步骤 1:下载 Bundle

打开命令行,进入项目目录,并执行以下命令以下载本 Bundle 的最新稳定版本

$ composer require northernco/maintenance-mode-bundle

步骤 2:启用 Bundle

然后,通过将其添加到项目 config/bundles.php 文件中注册的 Bundle 列表来启用此 Bundle

// config/bundles.php

return [
    // ...
    Northern\MaintenanceModeBundle\NorthernMaintenanceModeBundle::class => ['all' => true],
];

用法

Bundle 安装完成后,您可以通过运行以下命令来在应用程序中启用和禁用维护模式

要启用维护模式: bin/console app:maintenance --enable

要禁用维护模式: bin/console app:maintenance --disable

覆盖默认模板

要覆盖默认的维护模式模板,请在 templates/bundles/NorthernMaintenanceModeBundle/maintenance.html.twig 创建自己的模板文件