定制 atwx/silverstripe-frontdesk-kit 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

atwx/silverstripe-frontdesk-kit

Composer 安装命令:

composer require atwx/silverstripe-frontdesk-kit

包简介

A frontend kit for Silverstripe framework

README 文档

README

A modern CRUD frontend toolkit for Silverstripe 6, built on Tailwind CSS + DaisyUI + HTMX + Alpine.js + Chart.js.

Rather than rigid table columns from $summary_fields and FieldList blobs for filters, you define columns, filters, and row actions cleanly in the controller — inspired by Laravel Backpack and Django Admin.

Requirements

  • PHP ^8.4
  • Silverstripe Framework ^6
  • Composer

Installation

composer require atwx/silverstripe-frontdesk-kit

Expose assets and flush Silverstripe:

composer install
vendor/bin/sake dev/build flush=1

Quick Start

See docs/quickstart.md for a step-by-step guide to setting up a new project.

Documentation

Document Contents
docs/quickstart.md New project setup, first controller
docs/columns.md Defining columns, links, formatting, export
docs/filters.md TextFilter, SelectFilter, DateRangeFilter
docs/row-actions.md Row actions, HTMX actions, conditional visibility
docs/templates.md Overriding templates, HTMX partial rendering
docs/charts.md Declarative Chart.js rendering via Chart include
docs/frontend.md Building CSS/JS, theming via CSS custom properties

Overview

class ContactManageController extends FrontdeskController
{
    private static $managed_model = Contact::class;
    private static $url_segment = 'contacts';
    private static $title = 'Contacts';

    protected function defineColumns(): ColumnCollection
    {
        return ColumnCollection::fromSummaryFields(Contact::class)
            ->make('Title', 'Name')->link('view/{ID}')->end()
            ->make('Company', 'Company')->end();
    }

    protected function defineFilters(): FilterCollection
    {
        return FilterCollection::create()
            ->add(TextFilter::create('Query', 'Search')
                ->apply(fn($list, $v) => $list->filterAny([
                    'FirstName:PartialMatch' => $v,
                    'Surname:PartialMatch'   => $v,
                ])));
    }

    protected function formFields(FieldList $fields): FieldList
    {
        $fields->removeByName('InternalNote');
        return $fields;
    }
}

Charts

Chart.js is bundled. Render any Chart.js config declaratively:

<% include Atwx\SilverstripeFrontdeskKit\Includes\Chart
    ChartTitle='Revenue (12 months)',
    ChartHeight='360px',
    ChartConfigJson=$RevenueChartJson %>

Expose a JSON method on the controller:

public function RevenueChartJson(): string
{
    return json_encode([
        'type' => 'line',
        'data' => ['labels' => $labels, 'datasets' => [...]],
        'options' => ['responsive' => true, 'maintainAspectRatio' => false],
    ]);
}

The bundled JS picks up every [data-fdk-chart] canvas on page load and after HTMX swaps.

Form Field Styling

DaisyUI utility classes (input, select, textarea, checkbox, btn) are applied automatically to any form field rendered inside a FrontdeskController or Security controller context — the CMS admin is left untouched.

Frontend Build

cd vendor/atwx/silverstripe-frontdesk-kit
yarn install
yarn build

Theme without rebuilding via CSS custom properties:

/* In your app CSS */
:root {
    --p: 220 80% 30%;   /* DaisyUI primary colour */
    --s: 160 60% 40%;   /* DaisyUI secondary colour */
}

Licence

BSD-3-Clause

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-03-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固