承接 wdmg/yii2-widgets 相关项目开发

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

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

wdmg/yii2-widgets

Composer 安装命令:

composer require wdmg/yii2-widgets

包简介

Widgets collection for Yii2

README 文档

README

Yii2 Downloads Packagist Version Progress GitHub license

Yii2 Widgets

Custom widgets collection for Yii2

NavContents::widget()

The widget parses your HTML code for the presence of h1-h6 headers and forms a navigation list with the correct href, after which it render a Boostrap Nav before content.

If the h1-h6 headers does not have an id attribute, it will be generated automatically. The rest of the attributes of the headers, whether class, style or data will also be saved.

MenuContents::widget()

The same as in the case of NavContents::widget(), but the usual <ul> list is formed at the output.

Requirements

  • PHP 5.6 or higher
  • Yii2 v.2.0.33 and newest

Installation

To install the widgets, run the following command in the console:

$ composer require "wdmg/yii2-widgets"

Usage

Example of usecase NavContents::widget() in view instance:

<?php

use wdmg\widgets\NavContents;

$content = '<h1>Header H1</h1><p>Some text, some text...</p><p>Some text, some text...</p>'

?>

<?= NavContents::widget([
    'id' => "list1",
    'content' => $content, // where `$content` the html source with h1-h6 headers
    'renderContent' => true, // if `true` (by default) render content html after table of contents
    'transliterate' => true, // if need to convert href and ID to Latin (Cyrillic for example)
    'options' => [
        'class' => 'nav nav-stacked'
    ],
    ... // and other options for yii\bootstrap\Nav::widget()
]); ?>

Example of usecase MenuContents::widget() in view instance:

<?php

use wdmg\widgets\MenuContents;

$content = '<h1 id="test-header" class="header">Header H1</h1><p>Some text, some text...</p><p>Some text, some text...</p>'

?>

<?= MenuContents::widget([
    'id' => "list2",
    'content' => $content, // where `$content` the html source with h1-h6 headers
    'renderContent' => true, // if `true` (by default) render content html after table of contents
    'transliterate' => true, // if need to convert href and ID to Latin (Cyrillic for example)
    'options' => [
        'class' => 'list-toc'
    ],
    ... // and other options for yii\widgets\Menu::widget()
]); ?>

Example of usecase LangSwitcher::widget() in view instance of dashboard:

<?php

use wdmg\widgets\LangSwitcher;

<?php
    echo LangSwitcher::widget([
        'label' => 'Language version',
        'model' => $model,
        'renderWidget' => 'button-group',
        'createRoute' => 'news/create', // string or array
        'updateRoute' => 'news/update', // string or array
        'supportLocales' => $this->context->module->supportLocales,
        'versions' => (isset($model->source_id)) ? $model->getAllVersions($model->source_id, true) : $model->getAllVersions($model->id, true),
        'options' => [
            'id' => 'locale-switcher',
            'class' => 'pull-right'
        ]
    ]);
?>

Example of usecase AliasInput::widget() in view instance of dashboard:

<?php

use wdmg\widgets\AliasInput;

<?= $form->field($model, 'alias')->widget(AliasInput::class, [
    'labels' => [
        'edit' => 'Edit',
        'save' => 'Save'
    ],
    'options' => [
        'baseUrl' => $model->url
    ]
])->label('Post URL'); ?>

Status and version [in progress development]

  • v.1.1.0 - Update copyrights
  • v.1.0.4 - URL`s options in LangSwitcher
  • v.1.0.3 - Added AliasInput::widget()
  • v.1.0.2 - Added LangSwitcher::widget()
  • v.1.0.1 - Up to date dependencies
  • v.1.0.0 - Added NavContents::widget() and MenuContents::widget()

wdmg/yii2-widgets 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

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