承接 surgems/env-condition 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

surgems/env-condition

最新稳定版本:2.0.0

Composer 安装命令:

composer require surgems/env-condition

包简介

Statamic Tag that only displays it's content in a selected environment.

README 文档

README

Env Condition is a Statamic Modifier that only displays it's content in a selected environment.

Features

This addon does:

  • Allows you to display content/fields based on the APP_ENV.

How to Install

You can use this addon by running the following command from your project root:

composer require surgems/env-condition

How to Use

This addons uses 3 environments:

  • local
  • staging
  • production

Tag

You can display content inside the tag depending on the condition of the APP_ENV.

There are 2 tag Methods:

{{ if_env env="local" }}
    {{ content | widont }}
{{ /if_env }}

This would display the content inside the tags if the APP_ENV IS 'local'.

{{ if_env:not env="local" }}
    {{ content | widont }}
{{ /if_env:not }}

This would display the content inside the tags if the APP_ENV IS NOT 'local'.

You can also add multiple parameters:

{{ if_env:not env="local|staging" }}
    {{ content | widont }}
{{ /if_env:not }}

This would display the content inside the tags if the APP_ENV IS NOT 'local' OR 'staging'.

Modifier

You can display a field whenever the APP_ENV is a certain environment.

There are 2 modifiers:

{{ field | if_env:local }}

This would display the field content if the APP_ENV IS equal to 'local'.

{{ field | if_env_not:local }}

This would display the field content if the APP_ENV IS NOT equal to 'local'.

You can also add multiple parameters:

{{ field | if_env:local:staging }}

统计信息

  • 总下载量: 85
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固