承接 stnvh/silverstripe-taggedfield 相关项目开发

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

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

stnvh/silverstripe-taggedfield

Composer 安装命令:

composer require stnvh/silverstripe-taggedfield

包简介

Creates a tag field, similar to how a ListBoxField looks.

README 文档

README

Latest Stable Version License

Creates a tag field, similar to how a ListBoxField looks.

Tagged Field

By Stan Hutcheon - Bigfork Ltd

Installation:

Composer:

composer require "stnvh/silverstripe-taggedfield" "~1"

Download:

Clone this repo into a folder called taggedfield in your silverstripe installation folder.

Usage:

Initialize it like any other field. Make sure you have a 'Text' entry in the database to store the values:

<?php

class MyObject extends DataObject {

	private static $db = array(
		'Tags' => 'Text'
	);

	public function getCMSFields() {
		$fields = parent::getCMSFields();

		$taggedField = TaggedField::create('Tags');

		$fields->addFieldToTab('Root.Main', $taggedField);

		return $fields;
	}

	// To use the tags in the template correctly
	public function Tags() {
		$tags = explode(',', $this->Tags);
		foreach($tags as $i => $tag) {
			$tags[$i] = array('Tag' => $tag);
		}
		return ArrayList::create($tags);
	}

}

In the template:

	<% loop Tags %>
		<span class="tag">{$Tag}</span>
	<% end_loop %>

After installing via composer, you must /dev/build

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-10-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固