承接 carbon/condition 相关项目开发

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

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

carbon/condition

Composer 安装命令:

composer require carbon/condition

包简介

This package provides some fusion helper for making writing conditions (`@if`) easier.

README 文档

README

Latest Stable Version Total Downloads License GitHub forks GitHub stars GitHub watchers

Carbon.Condition Package for Neos CMS

This package provides some fusion helper for making writing conditions (@if) easier.
You can look at a real world example here

Installation

Carbon.Condition is available via packagist. Add "carbon/condition" : "^2.0" to the require section of your composer.json or run composer require carbon/condition.

Carbon.Condition:Case

Link to the fusion file
Return true if a content element or a node type definition is on a document.
Example usage:

value = 'FooBar'
value.@if.render = Carbon.Condition:Case {
    content {
        nodeType = 'Foo.Bar:NodeType'
        propertyFilter = '[row != "one"]'
    }
}

In the example above the value FooBar gets only rendered if a content node type Foo.Bar:NodeType with the property row set not to one is on the current document.

value = 'FooBar'
value.@if.render = Carbon.Condition:Case {
    document.nodeType = 'Foo.Bar:MixinNodeType'
}

In the example above the value FooBar gets only rendered if the document has the mixin Foo.Bar:MixinNodeType.

You can also mix the conditions:

value = 'FooBar'
value.@if.render = Carbon.Condition:Case {
    content {
        nodeType = 'Foo.Bar:MixinLightbox'
        propertyFilter = '[lightbox=true]'
    }
    document {
        nodeType = 'Foo.Bar:MixinLightbox'
        propertyFilter = '[lightbox=true]'
    }
}

In the example above the value FooBar gets only rendered if the document or a content element has the mixin Foo.Bar:MixinLightbox and the property lightbox set to true.

Default values

node = ${documentNode}

enabled = true

content {
    collection = '[instanceof Neos.Neos:ContentCollection]'
    nodeType = null
    propertyFilter = ''
    filter = ${this.nodeType ? ('[instanceof ' + this.nodeType + ']' + this.propertyFilter) : null}
}

document {
    nodeType = null
    propertyFilter = ''
    filter = ${this.nodeType ? ('[instanceof ' + this.nodeType + ']' + this.propertyFilter) : null}
}

context {
    backend = true
    live = false
}

Overview of properties:

Property Description
node The node as starting point for the query
enabled If set to false, it return always false
content.nodeType Set the node type
content.propertyFilter This string gets appended to the content.filter. Example usage see above
content.collection The filter string for the content collection. Normally you don't need to change this property.
content.filter The filter string for the content element. Normally you don't need to change this property.
document.nodeType Set the node type
document.propertyFilter This string gets appended to the document.filter. Example usage see above
document.filter The filter string for the document element. Normally you don't need to change this property.
context.backend If set to true, the value is always return true in backend context
context.live If set to true, the value is always return true in live context

Carbon.Condition:Properties

Link to the fusion file
Helper for checking if the element should get rendered or not. Example usage:

@if.render = Carbon.Condition:Properties {
    properties = 'title,image'
}

In the example above the condition is only get true if the node has title and image set.

Default values

node = ${node}

properties = null
operator = 'AND'

context {
    backend = true
    live = false
}

Overview of properties:

Property Default value Description
node ${node} The node as starting point for the query
properties false Set the needed properties as comma seperated string. You can mix string and object based properties.
operator 'AND' If set to 'AND' or '&&', all properties have to be set. If it set to 'OR' or '||' only one property is needed
context.backend true If set to true, the value is always return true in backend context
context.live false If set to true, the value is always return true in live context

carbon/condition 适用场景与选型建议

carbon/condition 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 59.52k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 01 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「flow」 「helper」 「condition」 「Neos」 「carbon」 「FUSION」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 carbon/condition 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 carbon/condition 我们能提供哪些服务?
定制开发 / 二次开发

基于 carbon/condition 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 59.52k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 10
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2018-01-16