-
Backend
-
Behaviors
-
FormController
-
ImportExportController
-
ListController
-
RelationController
- FormController
- ImportExportController
- ListController
- RelationController
- ReorderController
- UserPreferencesModel
-
-
Classes
-
Dashboard
-
NavigationManager
-
WidgetManager
- AuthManager
- BackendController
- Controller
- ControllerBehavior
- DashboardManager
- DashboardWidgetBase
- FilterScope
- FilterWidgetBase
- FormField
- FormTabs
- FormWidgetBase
- ListColumn
- LoginCustomization
- MainMenuItem
- NavigationManager
- ReportDataSourceBase
- ReportDataSourceManager
- ReportWidgetBase
- RoleManager
- RolePermission
- SettingsController
- SideMenuItem
- Skin
- StaticReportWidgetContainer
- VueComponentBase
- WidgetBase
- WidgetManager
- WildcardController
-
-
Controllers
-
Database
-
Facades
-
FilterWidgets
-
FormWidgets
-
Helpers
-
Models
-
BrandSetting
-
ExportModel
-
ImportModel
- AccessLog
- BrandSetting
- Dashboard
- EditorSetting
- ExportModel
- ImportModel
- Preference
- ReportDataCache
- User
- UserGroup
- UserPreference
- UserPreferenceModel
- UserRole
- UserThrottle
-
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
-
Filter
-
Form
-
Lists
-
Table
- Filter
- Form
- Lists
- ListStructure
- ReportContainer
- RoleImpersonator
- Search
- SiteSwitcher
- Table
- Toolbar
-
- ServiceProvider
-
-
Cms
-
Classes
-
Controller
-
EditorExtension
-
Layout
-
Page
-
Partial
-
Theme
- AjaxResponse
- Asset
- CmsCompoundObject
- CmsController
- CmsDemoTrafficDataGenerator
- CmsException
- CmsObject
- CmsObjectCache
- CmsObjectCollection
- CmsReportDataSource
- CmsStatusDataSource
- CodeBase
- CodeParser
- ComponentBase
- ComponentBehavior
- ComponentHelpers
- ComponentManager
- ComponentModuleBase
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- Meta
- Page
- PageCode
- PageManager
- Partial
- PartialCode
- PartialStack
- PartialWatcher
- Router
- Snippet
- SnippetManager
- Theme
- ThemeManager
- ThisVariable
- TrafficLogger
-
-
Components
-
Console
-
Controllers
-
Database
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- AjaxPartialTokenParser
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- GetAttrAdjuster
- GetAttrNode
- Loader
- MetaNode
- MetaTokenParser
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
Traits
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Helpers
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
PresetManager
-
SiteManager
-
UiManager
-
UpdateManager
- AppBase
- CombineAssets
- DependencyResolver
- DriverBehavior
- ErrorHandler
- MailManager
- ManifestCache
- MarkupExtensionItem
- MarkupManager
- ModelBehavior
- PagerElement
- PluginBase
- PluginManager
- PresetManager
- ProductDetail
- RateLimiter
- ResizeImageItem
- ResizeImages
- SettingsManager
- SettingsMenuItem
- SiteManager
- SystemController
- SystemReportDataSource
- UiElement
- UiManager
- UpdateManager
- VersionManager
-
-
Console
- ComposerScript
- OctoberAbout
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberOptimize
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- OctoberUtilCommands
- OctoberUtilPatches
- OctoberUtilRefitLang
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- PluginSeed
- PluginTest
- ProjectSync
-
Controllers
-
Database
-
Facades
-
Helpers
-
Middleware
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Tailor
-
Behaviors
-
Classes
-
Blueprint
-
BlueprintIndexer
-
EditorExtension
-
Relations
-
SchemaBuilder
-
Scopes
- Blueprint
- BlueprintCollection
- BlueprintErrorData
- BlueprintException
- BlueprintIndexer
- BlueprintModel
- BlueprintVerifier
- ComponentVariable
- ContentFieldBase
- EditorExtension
- FieldManager
- Fieldset
- NavigationItem
- PermissionItem
- RecordIndexer
- SchemaBuilder
- SchemaPruner
-
-
Components
-
Console
-
ContentFields
-
Controllers
-
Models
-
EntryRecord
-
GlobalRecord
-
RecordImport
- ContentSchema
- EntryRecord
- GlobalRecord
- NestedFormItem
- PreviewToken
- RecordExport
- RecordImport
- RepeaterItem
-
-
Traits
-
VueComponents
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
brand
-
files
-
filter
-
form
-
list
-
menu
-
page
-
roles
-
site
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
internalTrafficStatistics
-
object
-
page
-
pageLookup
-
resizer
-
router
-
sitePicker
-
template
-
theme
- extendTwig
-
-
deferredBinding
-
editor
-
extension
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
filter
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
-
/docs/api/model/afterboot
-
/docs/api/model/aftercreate
-
/docs/api/model/afterdelete
-
/docs/api/model/afterfetch
-
/docs/api/model/afterinit
- afterRelation
- afterRestore
-
/docs/api/model/aftersave
- afterTrash
-
/docs/api/model/afterupdate
- afterValidate
-
/docs/api/model/beforecreate
-
/docs/api/model/beforedelete
-
/docs/api/model/beforefetch
- beforeGetAttribute
- beforeRelation
- beforeReplicate
- beforeRestore
-
/docs/api/model/beforesave
- beforeSetAttribute
-
/docs/api/model/beforeupdate
- beforeValidate
- extendBlueprint
- getAttribute
- newInstance
- saveInternal
- setAttribute
-
-
pages
-
snippet
-
-
site
-
system
-
assets
- beforeAddAsset
-
/docs/api/system/assets/beforebundleasset
-
console
-
mirror
-
-
mail
-
reportwidgets
-
resizer
-
settings
-
site
-
updater
- extendConfigFile
- extendTwig
-
-
tailor
-
user
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
-
Traits
-
Util
- README
- AsseticServiceProvider
- AssetManager
- AssetWriter
- Combiner
- FilterManager
-
-
Auth
-
Combine
-
Composer
-
Config
-
Database
-
Attach
-
Concerns
-
Connections
-
Connectors
-
Factories
-
Models
-
Relations
-
Schema
-
Scopes
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- Dongle
- ExpandoModel
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- Replicator
- SortableScope
- TreeCollection
- Updater
-
-
Element
-
Filter
-
Form
-
Lists
-
Navigation
- ElementBase
- ElementHolder
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
-
-
Halcyon
-
Concerns
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Resize
-
Router
-
Scaffold
-
Support
-
Debug
-
Facades
-
Traits
- README
- Arr
- ClassLoader
- Collection
- Facade
- ModuleServiceProvider
- SafeCollection
- ServiceProvider
- Singleton
- Str
-
-
Translation
-
Validation
-
- Documentation
- API
- Cms
- Classes
- Theme
Cms\Classes\Theme
Overview
Theme class represents the CMS theme CMS theme is a directory that contains all CMS objects - pages, layouts, partials and asset files.. The theme parameters are specified in the theme.ini file in the theme root directory.
Implements
- October\Contracts\Twig\CallsMethods
Protected Properties
protected string $dirName
dirName specifies the theme directory name
protected static mixed $activeThemeCache
activeThemeCache in memory
protected static mixed $editThemeCache
editThemeCache in memory
protected mixed $configCache
configCache keeps the cached configuration file values
Public Methods
public __get()
public __get($name): void
__get magic
public __isset()
public __isset($key): void
__isset magic
public static all()
public static all(): array
all returns all themes on disk
public static allAvailable()
public static allAvailable(): array
allAvailable returns all available themes, those that are not locked
public databaseLayerEnabled()
public databaseLayerEnabled(): bool
databaseLayerEnabled checks global and local config
public static exists()
public static exists($dirName): bool
exists determines if a theme with given directory name exists
public static getActiveTheme()
public static getActiveTheme(): Cms\Classes\Theme|null
getActiveTheme returns the active theme object
public static getActiveThemeCode()
public static getActiveThemeCode(): string|null
getActiveThemeCode returns the active theme code.
By default the active theme is loaded from the cms.active_theme config item. If there's a back-end user session, loads the theme code from the CMS Editor Edit Theme user preference.
This behavior can be overridden by the cms.theme.getActiveTheme event listener.
public getCachedThemePath()
public getCachedThemePath(): string
public getConfig()
public getConfig(): array
getConfig reads the theme.yaml file and returns the theme configuration values
public getConfigArray()
public getConfigArray($name): array
getConfigArray returns an array value from the theme configuration file by its name
If the value is a string, it is treated as a YAML file and loaded.
public getConfigValue()
public getConfigValue($name, $default = null): void
getConfigValue returns a value from the theme configuration file by its name
public getCustomData()
public getCustomData(): Cms\Models\ThemeData
getCustomData returns data specific to this theme
public getDatasource()
public getDatasource(): October\Rain\Halcyon\Datasource\DatasourceInterface
getDatasource returns the theme's datasource
public getDirName()
public getDirName(): string
getDirName returns the theme directory name
public static getEditTheme()
public static getEditTheme(): Cms\Classes\Theme|null
getEditTheme returns the edit theme
public static getEditThemeCode()
public static getEditThemeCode(): string|null
getEditThemeCode returns the edit theme code
There are several ways the edit theme can be set. The code loads the edit theme from the following sources: → CMS Editor edit theme for the currently authenticated back-end user, if any. → cms.edit_theme config item. → CMS Active theme. → cms.theme.getEditTheme event. The theme code returned by the event handler has the highest priority.
public getFormConfig()
public getFormConfig(): array
getFormConfig returns the dedicated form
option that provide form fields
for customization, this is an immutable accessor for that and also an
solid anchor point for extension
public getId()
public getId(): string
getId is a helper for {{ theme.id }} twig vars that returns a unique string for this theme
public getParentOptions()
public getParentOptions(): array
getParentOptions returns dropdown options for a parent theme
public getParentTheme()
public getParentTheme(): Cms\Classes\Theme|null
getParentTheme returns a parent theme, if enabled
public getPath()
public getPath($dirName = null): string
getPath returns the absolute theme path.
public getPreviewImageUrl()
public getPreviewImageUrl(): string
getPreviewImageUrl returns the theme preview image URL
If the image file doesn't exist returns the placeholder image URL.
public getTwigMethodNames()
public getTwigMethodNames(): array
getTwigMethodNames returns a list of method names that can be called from Twig.
public hasCustomData()
public hasCustomData(): bool
hasCustomData returns true if this theme has form fields that supply customization data
public hasParentTheme()
public hasParentTheme(): bool
hasParentTheme checks if a parent theme is defined
public hasSeedContent()
public hasSeedContent(): void
hasSeedContent returns true if some seed content is available
public isActiveTheme()
public isActiveTheme(): bool
isActiveTheme returns true if this theme is the chosen active theme
public isLocked()
public isLocked(): bool
isLocked returns true if the theme cannot be used
public listPages()
public listPages($skipCache = false): void
listPages returns a list of pages in the theme This method is used internally in the routing process and in the backend UI. Skipping cache indicates if the pages should be reloaded from the disk bypassing the cache.
public static load()
public static load($dirName): Cms\Classes\Theme
load the theme
public registerHalcyonDatasource()
public registerHalcyonDatasource(): void
registerHalcyonDatasource ensures this theme is registered as a Halcyon datasource
public removeCustomData()
public removeCustomData(): bool
removeCustomData removes data specific to this theme
public static resetCache()
public static resetCache(): void
resetCache resets any memory or cache involved with the active or edit theme
public static resetEditTheme()
public static resetEditTheme(): void
public secondLayerEnabled()
public secondLayerEnabled(): bool
secondLayerEnabled is true if two or more datasources exist
public static setActiveTheme()
public static setActiveTheme($code): void
setActiveTheme sets the active theme
The active theme code is stored in the database and overrides the configuration cms.active_theme config item.
public setDirName()
public setDirName($dirName): void
setDirName sets the theme directory name
public static setEditTheme()
public static setEditTheme($code): void
setEditTheme sets the editing theme
public themeIsCached()
public themeIsCached(): bool
public useParentAsset()
public useParentAsset($relativePath): bool
useParentAsset determines if a parent asset should be used
public writeConfig()
public writeConfig($values = [], $overwrite = false): void
writeConfig to the theme.yaml file with the supplied array values
Protected Methods
protected static getEditThemeCodeFromPreference()
protected static getEditThemeCodeFromPreference(): void
protected writeComposerFile()
protected writeComposerFile($data): void
writeComposerFile writes to a composer file for a theme