承接 dilshoddevoloper/yii2-cms-private 相关项目开发

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

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

dilshoddevoloper/yii2-cms-private

Composer 安装命令:

composer require dilshoddevoloper/yii2-cms-private

包简介

Yii2 cms private extension

README 文档

README

The extension allows:

  • make html blocks of html contents, files, images.
  • make collections for options like tags, categories
  • make entities for items like sliders, products, reviews, articles, pages
  • support up to 5 languages
  • support SEO meta tags
  • make multiple menu with parenting feature

Installation

  • Install with composer:
composer require afzalroq/yii2-cms "^1.0"
  • After composer install run console command for create tables:

Add to console config for auto discover migrations

'controllerMap' => [
    'migrate' => [
        'class' => MigrateController::class,
        'autoDiscover' => true,
        'migrationPaths' => [
            '@vendor/afzalroq/yii2-cms/migrations'
        ],
    ],
]
php yii migrate/up --migrationPath=@vendor/afzalroq/yii2-cms/migrations

Setup in common config file

CKEditor use Elfinder plugin for save files and images. Refer Elfinder readme for proper configuration

  • Language indexes related with database columns.
  • Admin panel tabs render by array values order
  • For Items, Options and Menu must be isset common\models\User model
'modules' => [
    'cms' => [ // don`t change module key
        'class' => '@afzalroq\cms\Module',
        // storage
        'path' => $params['storageRoot'], // dirname(__DIR__, 2) . '/storage'
        'host' => $params['storageHostInfo'], // 'https://site.example'    
        'cache' => 'cache', // default cache component name
        'cacheDuration' => 3600, // default cache duration 3600 second
        // images
        'imageOperation' => 'cropResize',
        'imageBackground' => 'transparent',
        'imageXPos' => 'center',
        'imageYPos' => 'center',
        'fallback' => $params['storageRoot'] . '/fallback.png',
        'watermark' => $params['storageRoot'] . '/logo.png',
        // i18n
        'languages' => [
            'ru' => [
                'id' => 0, // must start from 0 up to 4
                'name' => 'English',
            ],
            'en' => [
                'id' => 1,
                'name' => 'Русский',
            ],
            'uz' => [
                'id' => 2,
                'name' => 'O`zbek tili',
            ],
        ],
        // for add to menu controller actions
        'menuActions' => [
            '' => 'Home',
            'site/contacts' => 'Contacts',
        ]
    ],
]

By default uses for caching component with name "cache". Config as belove:

'components' => [
    'cache' => [
        'class' => 'yii\caching\FileCache',
        'cachePath' => Yii::getAlias('@frontend') . '/runtime/cache'
    ],
]
  • In admin panel open management via link:
/cms/home/index

Added Laravels dd() (dump and die) method

$array = ['a', 'b'];
dd($array);

Examples

TODO

  • test
  • Copy from extension root directory example widgets for frontend integration

Usage

Use in frontend CController extending CMSController for proper menu generated links work

class CController extends CMSController {
    
    public function actionCollection(string $c)
    {
    }

    public function actionOption(string $c, string $o)
    {
    }

    public function actionEntity(string $e)
    {
    }

    public function actionItem(string $e, int $i)
    {
    }
}

Unit getter

Unit::get('slug'); // will return data using cache

Item Getters

\afzalroq\cms\entities\front\OaI::getItemIdsByCollection($slug) : array // of item Ids
\afzalroq\cms\entities\front\OaI::getItemIdsByOption($slug) : array // of item Ids
 $item->getText1(); // for get Text 1
 $item->getText2(); // for get Text 2
 $item->getText3(); // for get Text 3
 $item->getText4(); // for get Text 4
 $item->getText5(); // for get Text 5
 $item->getText6(); // for get Text 6
 $item->getText7(); // for get Text 7
 

 //for to get meta description and meta keywords just use this command below:
 $item-registerMetaTags(); //it generates meta tags in your view page

Return File URI

 $item->getFile1(); // for get File 1
 $item->getFile2(); // for get File 2
 $item->getFile3(); // for get File 3 

Return Datetime with specified format

 $item->getDate($format); // for get date with format like "d.m.Y H:i:s"

Return image URI by specified operation(default cropResize)

View all image operations & examples from documentation

// get gallery main photo URI
$item->getGalleryPhoto(width, height, operation, background, xPos, yPos)

// get gallery photos URI
$items->getPhotos() // and use with "foreach(){}"

// item photos URI
 $item->getPhoto1(width, height, operation, background, xPos, yPos); // for get Photo 1
 $item->getPhoto2(width, height, operation, background, xPos, yPos); // for get Photo 2
 $item->getPhoto3(width, height, operation, background, xPos, yPos); // for get Photo 3

Option Getters

 $option->getName(); // for get Name

 $option->getContent(); // for get Content

 $option->getPhoto1(); // for get Photo 1
 $option->getPhoto2(); // for get Photo 2

 $option->getFile1(); // for get File 1
 $option->getFile2(); // for get File 2

 //for to get meta description and meta keywords just use this command below:
 $option-registerMetaTags(); //it generates meta tags in your view page

Option and Items searches

 \afzalroq\cms\entities\front\Items::getEntityItemSearchResults((array) $entitySlugs, $search); // get search results with entity and items
 
 \afzalroq\cms\entities\front\Items::getOptionItemSearchResults((array) $optionSlugs, $search); // get search results with option and items

 \afzalroq\cms\entities\front\Options::getOptionSearchResults((array) $optionSlugs, $search); // get search results with options
 

dilshoddevoloper/yii2-cms-private 适用场景与选型建议

dilshoddevoloper/yii2-cms-private 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 dilshoddevoloper/yii2-cms-private 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-03-20