承接 evgeniy-it/widget-bundle 相关项目开发

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

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

evgeniy-it/widget-bundle

Composer 安装命令:

composer require evgeniy-it/widget-bundle

包简介

WidgetBundle is something similar to modx snippets, makes your content managment system powerful.

README 文档

README

Widget bundle is something similar to modx snippets, makes your content managment system powerful.

Installation

With composer:

composer require evgeniy-it/widget-bundle

Widget will be ready to work

Getting started

Render widget via such a shortcode:

[[widget_name? &setting=`1` &settingArray=`[1,2,3]` &settingAssocArray=`{'item1':'value1','item2':'value2'}`]] 

Widget also can be nested multiple times:

[[widget_name? &nestedSetting=`[[widget_name2? &setting1=`value1` &setting2=`[[widget3]]`]]`]]

For parsing and rendering use twig widget filter, it will find all widgets, parse and process them:

{{ some_string_var|widget}}

Be sure about widget syntax:

  • widget name must be ended with ?
  • any option must start with &
  • any option value must be wrapped in `
  • a widget must be started with [[ and ends with ]]

#Using:

##Default widgets:

Simple widget

This widget just renders setting variables into specified template. If template is not specified it will render only option &content. You can specify template as well. Specify template whether as a link or as a string..

#####Example:

Using default template:

{{ '[[simple? &content=`Hello world`]]'|widget }}

or nested

{{ '[[simple? &content=`[[simple? &content=`Hello world`]]`]]'|widget }}

Will output:

Hello world

Using custom template:

{{ '[[simple? &setting1=`value1` &setting2=`value2` &setting3=`value3` &template=`{{setting1}} - {{setting2}} - {{setting3}}`]]'|widget }}

or

{{ '[[simple? &setting1=`value1` &setting2=`value2` &setting3=`value3` &template=`AppBundle:Widget:simple.html.twig`]]'|widget }}
{# AppBundle:Widget:simple.html.twig#}
{{setting1}} - {{setting2}} - {{setting3}}

Will output:

value1 - value2 - value3

Repository widget

Renders collection of doctrine models

Params:

  • tpl - one item element template
  • model - entity model class
  • function - function that will be called
  • args - function args. json format

other params:

  • beforeTpl - contents piece of code that is being shown before item code structure
  • afterTpl - contents piece of code that is being shown after item code structure

in the specified template will be available those vars:

  • item - fetched entity model
  • idx (int) - ordinal Number
  • isFirst (bool) - if the element is the first
  • isLast (bool) - if it's the last element

Example:

<?php

namespace App\Bundle\ProductBundle\Entity;


class Product
{
    /**
     * @var string
     *
     * @ORM\Column(type="string", nullable=true)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(type="string", nullable=true)
     */
    private $slug;

    /**
     * @var bool
     *
     * @ORM\Column(type="boolean")
     */
    private $active = false;

    /**
     * @var ArrayCollection
     *
     * @ORM\OneToMany(targetEntity="App\Bundle\ShopBundle\Entity\ProductCategory", mappedBy="product", cascade={"persist"})
     */
    private $categories;
//...
{{ '[[repository? &model=`AppProductBundle:Product` &function=`findBySlug` &args=`["testslug"]` &tpl=`{{item.name}}` &tpl=`{{idx+1}}. {{item.name}}<br/>`]]'|widget }}

will output:

1. product 1
2. product 3
3. product 3
...
n. product n

evgeniy-it/widget-bundle 适用场景与选型建议

evgeniy-it/widget-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.09k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 12 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 evgeniy-it/widget-bundle 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-10