无法将自定义站点配置添加到Silverstripe 4

时间:2018-07-22 20:23:28

标签: php yaml silverstripe silverstripe-4

我紧跟在original docs之后,但 Open High Low Close Date 2018-07-16 2797.360107 2801.189941 2793.389893 2798.429932 2018-07-17 2789.340088 2814.189941 2789.239990 2809.550049 2018-07-18 2811.350098 2816.760010 2805.889893 2815.620117 2018-07-19 2809.370117 2812.050049 2799.770020 2804.489990 2018-07-20 2804.550049 2809.699951 2800.010010 2801.830078 2018-07-21 0 0 0 2111.111 没有生成db字段,也没有生成表单字段。

这是我的/dev/build

的值
app/_config/app.yml

这是我的--- Name: myproject --- SilverStripe\Core\Manifest\ModuleManifest: project: app --- Silverstripe\SiteConfig\SiteConfig: extensions: - CustomSiteConfig --- SilverStripe\Admin\LeftAndMain: extra_requirements_css: - public/resources/admin/css/custom.css

app/src/extensions/CustomSiteConfig.php

银条纹对我来说是新的,也许我在这里想不到。但是我现在要等待一个小时,无法正常工作。

1 个答案:

答案 0 :(得分:2)

I think the problem is in the way you're structuring your YAML:

---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
  project: app
---
Silverstripe\SiteConfig\SiteConfig:
  extensions:
    - CustomSiteConfig
---
SilverStripe\Admin\LeftAndMain:
  extra_requirements_css:
    - public/resources/admin/css/custom.css

The --- blocks are notating title blocks for each section of config, so the dividers you're using after the section with Name: myproject in it are creating more title blocks which won't be treated as config any more.

Try this:

---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
  project: app

Silverstripe\SiteConfig\SiteConfig:
  extensions:
    - CustomSiteConfig

SilverStripe\Admin\LeftAndMain:
  extra_requirements_css:
    - public/resources/admin/css/custom.css