定制 melisplatform/melis-demo-cms 二次开发

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

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

melisplatform/melis-demo-cms

Composer 安装命令:

composer require melisplatform/melis-demo-cms

包简介

Official Melis Platform Demo Site

README 文档

README

A demo site that provides examples on how to use the services of the Melis modules.

Getting Started

These instructions will get you a copy of the project up and running on your machine.

Vhost Configuration

MELIS_MODULE variable (identifies which site will be loaded as the front office for this domain).
We should set this variable with MelisDemoCms
Vhost should look like this:

<VirtualHost *:80>
    DocumentRoot "PATH_DOCROOT/public"
    <Directory "PATH_DOCROOT/public">
        Options +Indexes +FollowSymLinks +ExecCGI
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
        AllowOverride All
        Require all granted
    </Directory>

    ServerName www.mysite.local:80
    SetEnv MELIS_PLATFORM "development"
    SetEnv MELIS_MODULE "MelisDemoCms"

</VirtualHost>

Requirements

  • composer/installers
  • php 7

This will automatically be done when using composer.

Installing

Run the composer command:

composer require melisplatform/melis-demo-cms

Modules Used In The Site

  • Melis Front
  • Melis Engine
  • Melis Cms
  • Melis Cms Slider
  • Melis Cms Prospects
  • Melis Cms News

Services

  • MelisSiteConfigService
    Provides services to retrieve the config for your sites.
    File: /melis-front/src/Service/MelisSiteConfigService.php

    MelisFrontSiteConfigListener used to update the site's config on the regular config service by merging the config from the file and the one on the database.

    • getSiteConfigByKey(key, section = 'sites', language = null)
      This function retrieves a specific config by key.

      Parameter Type Description
      key String Key of the config.
      pageId Int Used determine the site id, name, and language and on where to get the config
      section String/Int The section on where to get the config or site Id
      language String Language on which to get the config

      To call the service.

      $siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
      

      To get a specific key of the current site and the language of the page with id 1

      $siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
      
      $config = $siteConfigSvc->getSiteConfigByKey('key', 1);
      

      But what if we wanted to get the key from another language of the current site? We can achieve this by defining the language on where to get the config.

      $siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
              
      $config = $siteConfigSvc->getSiteConfigByKey('key', 1,'sites', 'fr');
      // The language of the page is now overridden by the specified language.
      

      We can also get a particular key from another site by using the site Id.

      $siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
      
      $config = $siteConfigSvc->getSiteConfigByKey('key', 1, 1);
      // Return all the values of the specified key from all languages from the site with id 1.
      // The expected output is an array of values from different languages
      
      $config = $siteConfigSvc->getSiteConfigByKey('key', 1, 1, 'fr');
      // Return all the values of the specified key for the French language from the site with id 1.
      

      There is also a different section apart from sites. Currently, we have two sections which are sites and allSites.

      $siteConfigSvc = $this->getServiceManager()->get('MelisSiteConfigService');
      
      $config = $siteConfigSvc->getSiteConfigByKey('key', 1, 'allSites');
      // Returns the key from the allSites section of the config
      // Language for the page is not applied but still used to get the site id and name to map for the config
      
  • MelisSiteTranslationService
    Provides services to translate text and list all site translations
    File: /melis-front/src/Service/MelisSiteTranslationService.php

    • getText(translationKey, langId, siteId) .

      Parameter Type Description
      translationKey String Key of the translation.
      langId Int An identifier on which language to get the translation
      siteId Int An identifier on which site to get the translation

      To call the service.

      $melisSiteTranslationSvc = $this->getServiceManager()->get('MelisSiteTranslationService');
      

      To get a particular translation, You need to specify the translation key along with the lang id and site id.

      $test = $melisSiteTranslationService->getText('key', 1, 1);
      // Retrieves the translation for the language id 1 and site id 1.
      
  • For SEO, URL Services, and Templating Plugins See Full documentation for Melis Front here

  • For Page, and Tree System Services and Engine Plugins See Full documentation for Melis Engine here

  • For Cms plugins (tags, basic page elements) and Services See Full documentation for Melis Cms here

  • For Cms Slider Plugins and Services See Full documentation for Melis Cms Slider here

  • For Cms News Plugins (news list, latest news, and details) and Services See Full documentation for Melis Cms News here

  • For Cms Prospects Plugin (contact form) and Services See Full documentation for Melis Cms Prospects here

View Helpers

Melis Front View Helpers:

  • MelisSiteConfigHelper
    This helper is used to get a specific config for a site.
    File: /melis-front/src/View/Helper/MelisDragDropZoneHelper.php
    Function: SiteConfig(key, sectiom = 'sites', language = null)

    Parameter Type Description
    key String Key of the config.
    section String/Int The section on where to get the config or site Id
    language String Language on which to get the config

    To call the helper.

    $this->SiteConfig('key');
    

    To get a specific key from the config for the current site.

    $config = $this->SiteConfig('key');
    

    But what if we wanted to get the key from another language of the current site? We can achieve this by defining the language on where to get the config.

    $config = $this->SiteConfig('key', 'sites', 'fr');
    // The language of the page is now overridden by the specified language.
    

    We can also get a particular key from another site by using the site Id.

    $config = $this->SiteConfig('key', 1);
    // Return all the values of the specified key from all languages from the site with id 1.
    // The expected output is an array of values from different languages
    
    $config = $this->SiteConfig('key', 1, 'fr');
    // Return all the values of the specified key for the French language from the site with id 1.
    

    There is also a different section apart from sites. Currently, we have two sections which are sites and allSites.

    $config = $this->SiteConfig('key', 'allSites');
    // Returns the key from the allSites section of the config
    
  • MelisSiteTranslation
    This helper is used to get a specific translation for a site.
    File: /melis-front/src/View/Helper/MelisSiteTranslationHelper.php
    Function: getText(translationkey, langId, siteId)

    Parameter Type Description
    translationKey String Key of the translation.
    langId Int An identifier on which language to get the translation
    siteId Int An identifier on which site to get the translation

    To call the helper method.

    $this->SiteTranslation('translationKey', 'langId', 'siteId');
    

    To get a particular translation, You need to specify the translation key along with the lang id and site id.

    $text = $this->SiteTranslation('key', 1, 1);
    // Retrieves the translation for the language id 1 and site id 1.
    
  • For More Melis Front View Helpers See Full documentation for Melis Front here

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the OSL-3.0 License - see the LICENSE.md file for details

melisplatform/melis-demo-cms 适用场景与选型建议

melisplatform/melis-demo-cms 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 2.33k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 02 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 melisplatform/melis-demo-cms 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 2.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 6
  • Forks: 0
  • 开发语言: CSS

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2019-02-22