indiana-university/iukb-api-doc-content-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

indiana-university/iukb-api-doc-content-php

Composer 安装命令:

composer require indiana-university/iukb-api-doc-content-php

包简介

A class to make presenting knowledge base content easier

README 文档

README

A class to make presenting knowledge base content easier

Requirements

  • indiana-university/iukb-api-php

Usage

Usage is pretty simple, you simply call the create method statically on the factory class.

Basics

use Edu\Iu\Uits\KnowledgeBase\Document\ContentFactory;

$doc = $kb->getDocument('amyk');
$content = ContentFactory::create($doc->getContent());
echo $content->getBody();

Links

The links the KB returns may not be valid for your uses. To alter them a a function is provided to 'rebase' them. This will let you change the part before the four character document id.

use Edu\Iu\Uits\KnowledgeBase\Document\ContentFactory;

$doc = $kb->getDocument('amyk');
$content = ContentFactory::create($doc->getContent());

// If the hrefs are simply the doc id but need to be /help/docid
$content->rebaseKbLinks('', '/help/');

// If the links are full urls to the KB but need to be /help/docid
$content->rebaseKbLinks('https://kb.iu.edu/d/', '/help/');

Rivet Styles

Currently the KB uses a custom bootstrap theme and so the class names follow the bootstrap names. This is incompatible with Rivet. If you wish to display documents using the rivet styles you can simply use the rivetize() function.

This function is based on the Indiana University official "rivetizer" javascript library. For more information about the rivetizer, visit https://github.com/indiana-university/rivetizer.

use Edu\Iu\Uits\KnowledgeBase\Document\ContentFactory;

$doc = $kb->getDocument('amyk');
$content = ContentFactory::create($doc->getContent());
$content->rivetize();

Contributing

Contributions are welcome in the form of a github pull request. Note, for consistency sake, please run composer check and composer run-tests on any code you wish to contribute to this project and fix and resolve any issues found

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-06-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固