我有我的composer.json文件,我用它来启动所有新项目:
composer.json
{
"name": "silverstripe/installer",
"description": "The SilverStripe Framework Installer",
"require": {
"php": ">=5.3.3",
"silverstripe/cms": "3.2.0",
"silverstripe/framework": "3.2.0",
"silverstripe/reports": "3.2.0",
"silverstripe/siteconfig": "3.2.0",
"silverstripe-themes/simple": "3.1.*",
"silverstripe-australia/gridfieldextensions": "*",
"colymba/gridfield-bulk-editing-tools": "*"
},
"require-dev": {
"phpunit/PHPUnit": "~3.7"
},
"config": {
"process-timeout": 600
},
"prefer-stable": true,
"minimum-stability": "dev"
}
如果我想提供一些常用的dataobjects
和/ template
.ss
文件,我该怎么做呢?
例如,例如,如果我有一个SlideShow.php
Dataobject
我希望在每个项目中加入 - 目录结构如下TestFolder->mysite->code->dataobjects->Slideshow.php
- 如何将此文件拉入当我使用作曲家提取Silverstripe的新副本时,它会进入正确的目录。
Slideshow.php
<?php
class Slideshow extends DataObject {
private static $db = array(
'Title' => 'Varchar(255)',
'ButtonTitleText' => 'Varchar(255)',
);
private static $has_one = array(
'Image' => 'Image',
);
private static $summary_fields = array(
'Image.Thumbnail' => 'Thumbnail',
'Title' => 'Title'
);
}
答案 0 :(得分:2)
为什么不将幻灯片创建为一个模块,说实话起来相当简单..它只是将文件放在一个新的文件夹结构中。完成后,您可以将composer配置为在初始设置时将新模块拉入站点。