Skip to main content
Version: 2.0.0

Craft Core

yui/craft-core (Composer handle yui-core) is the shared Craft CMS control panel foundation for the YUI plugin ecosystem. It ships base classes, services, and CP UI components that every yStore plugin — including the main craft-plugin — extends rather than reimplements.

Craft Core has no storefront or checkout behavior of its own. It is a dependency, installed automatically whenever a yStore plugin is installed.

What plugins get from Craft Core

  • BasePlugin — enforces the yui-core dependency for dependent plugins and auto-injects the license CP nav entry when a plugin sets the hasLicenseCpNav flag.
  • AbstractNavPlugin — declarative CP subnav registration.
  • AbstractSectionedSettingsController — consistent, tabbed plugin settings layout.
  • AbstractDashboardController / CoreDashboardService — plugin dashboards with customizable, filterable widget layouts.
  • Licensing — license validation, trial mode, and feature entitlement checks (including wildcard and bundle entitlements), exposed to Twig via isFeatureEnabled and isTrialMode.
  • Notifications — a CP notification system with per-type opt-out preferences and level presets, driven by RegisterNotificationTypesEvent.
  • Shared CP componentsyui-empty-state, yc-notice, yc-hint, yc-help-guide, and the shared design token system used across plugin dashboards and widgets.
  • Shipping and payment basesAbstractShippingPlugin, AbstractShippingSettingsController, AbstractShippingDashboardService, BasePaymentSettingsModel, and AbstractShippingSettingsModel for satellite plugins.
  • UtilitiesCoreLog for plugin logging, ListingExportHelper for CSV/JSON/XML/XLSX export, a scheduling framework with cron support, backup/restore, PDF generation, and framework-agnostic Yii wrappers.

Where admins see Craft Core

Craft Core has no settings screen of its own. Admins interact with it indirectly, through every dependent plugin:

  • The License CP subnav entry shown on plugins with hasLicenseCpNav enabled.
  • CP notification preferences (which events notify, at what level) on each plugin's notification settings.
  • The shared dashboard, empty-state, and settings-layout components used consistently across plugin CPs.

Requirements

  • craftcms/cms ^5.9
  • PHP dependencies: dragonmantank/cron-expression, dompdf/dompdf, guzzlehttp/guzzle, pelago/emogrifier
  • Optional: nystudio107/craft-minify, detected at runtime via isMinifyEnabled() to enable HTML/JS/CSS minification.

For plugin developers

When building or maintaining a yStore plugin, extend Craft Core's base classes instead of duplicating CP scaffolding:

  • Extend BasePlugin and AbstractNavPlugin for plugin registration and CP navigation.
  • Extend AbstractSectionedSettingsController (or the payment/shipping-specific bases) for settings screens.
  • Extend AbstractDashboardController for a plugin dashboard.
  • Register notification types through RegisterNotificationTypesEvent instead of a bespoke notification mechanism.

See also