euf/elm_vocabularies
最新稳定版本:v0.0.1
Composer 安装命令:
composer require euf/elm_vocabularies
包简介
PHP library providing ELM controlled vocabularies.
README 文档
README
This library provides a curated set of ELM controlled vocabularies for use in PHP applications.
The controlled vocabularies included in this package are maintained by DG EMPL and disseminated by the Publications Office of the European Union on the EU Vocabularies website.
see Copyright notice
All editorial content (non-code assets) included in this package is licensed under the Creative Commons Attribution 4.0 International licence unless otherwise indicated.
The software as such is provided under the MIT license.
Installation
composer require euf/elm_vocabularies
Usage example
<?php require_once '../vendor/autoload.php'; use Elm\AssessmentType; use Elm\LearningActivityType; use Elm\LearningOpportunityType; use Elm\LearningScheduleType; use Elm\LearningSettingType; use Elm\ModeOfLearningAndAssessment; $vocabularies = [ $assessment = new AssessmentType(), $learningActivity = new LearningActivityType(), $learningOpportunity = new LearningOpportunityType(), $learningSchedule = new LearningScheduleType(), $learningSetting = new LearningSettingType(), $learningAssessment = new ModeOfLearningAndAssessment(), ]; foreach ($vocabularies as $vocabulary) { $name = $vocabulary->getName(); echo("Vocabulary: " . $name . "\n"); $list = $vocabulary->getLabeledList(); echo(json_encode($list, JSON_PRETTY_PRINT) . "\n"); $fakeKey = '0123456789'; echo("Testing " . $fakeKey . "\n"); echo(($vocabulary->keyExists($fakeKey)) ? "True" : "False"); echo("\n"); $randomKey = array_rand($list); echo("Testing " . $randomKey . "\n"); echo(($vocabulary->keyExists($randomKey)) ? "True" : "False"); echo("\n"); $randomItem = $vocabulary->get($randomKey); echo(json_encode($randomItem, JSON_PRETTY_PRINT) . "\n"); }
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-25