betterbrief/silverstripe-jsconfig

在您的前端和 SilverStripe 应用程序之间创建一个干净的 JavaScript 数据接口。

安装次数1,677

依赖者: 1

建议者: 0

安全性: 0

星标: 7

关注者: 4

分支: 2

开放性问题: 0

类型:silverstripe-module

v1.1.1 2016-06-26 08:23 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:52:51 UTC


README

使用方法

// Send an array of things to the frontend using JSConfig
JSConfig::add('name_of_json_key', MyObject::get()->toArray());
// Retrieve the inserted data, and use an imaginary template renderer to output some HTML based on that data set.
templateRenderer
    .setTemplate('MyObjectList')
    .process(JSCONFIG['name_of_json_key']);