定制 xanweb/c5-helpers 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xanweb/c5-helpers

Composer 安装命令:

composer require xanweb/c5-helpers

包简介

ConcreteCMS Helpers Suite

README 文档

README

Latest Version on Packagist Software License

Collection of useful helpers for ConcreteCMS

  • in_array_all Verify that all needles are in haystack array.
  • in_array_any Verify that at least one of needles is in haystack array.
  • strip_spaces Remove all spaces from the given string.
  • current_locale Get Current Page Locale.
  • current_language Get Current Page Language.
  • active_locale An Alias of \Localization::activeLocale().
  • active_language An Alias of \Localization::activeLanguage().
  • theme_path Get Site Theme Path
  • c5_date_format An Alias of \Concrete\Core\Localization\Service\Date::formatDate().
  • c5_date_format_custom An Alias of \Concrete\Core\Localization\Service\Date::formatCustom().
  • Xanweb\Helper\Page::getBlock and Xanweb\Helper\Page::getBlocks for fetching block(s) from page

Installation

Include library to your composer.json

composer require xanweb/c5-helpers

Usage of Xanweb\Helper\Page

    use Xanweb\Helper\Page as PageHelper;

    $ph = new PageHelper(
        $page, // Page Object
        ['Header', 'Footer'], // Optional argument to exclude some areas from fetching
        ['Main'] // Optional argument to include some areas in fetching
    );
    
    // Get the first valid instance of required block
    $contentBlockController = $ph->getBlock(
        'content', // Block Type Handle 
        function (BlockController $bController) { // Optional callable to test for valid block
            return !empty($bController->getContent());
        }
    );

    // Get the first valid instances of required blocks
    $blocksControllers = $ph->getBlocks(
        ['image', 'content'], // Block Types Handle 
        function (BlockController $bController) { // Optional callable to test for valid block
            if ($bController instanceof \Concrete\Block\Image\Controller) {
                return is_object($this->getFileObject());
            }

            if ($bController instanceof \Concrete\Block\Content\Controller) {
                return !empty($bController->getContent());
            }

            return false;
        }
    );

    /**
     *  - $blocksControllers array is indexed by btHandle: ['image' => $bController, 'content' => $bController]
     *  - If no block is found $blocksControllers will be an empty array 
     */  

xanweb/c5-helpers 适用场景与选型建议

xanweb/c5-helpers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 606 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 02 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 xanweb/c5-helpers 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-18