-
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
- Backend
- Behaviors
- ListController
Backend\Behaviors\ListController
Overview
ListController adds features for working with backend lists
This behavior is implemented in the controller like so:
public $implement = [
\Backend\Behaviors\ListController::class,
];
public $listConfig = 'config_list.yaml';
The $listConfig property makes reference to the list configuration
values as either a YAML file, located in the controller view directory,
or directly as a PHP array.
Extends
See Also
Public Properties
There are no public properties in the class.
Show inherited public properties
Inherited Public Properties
- $extendableStaticCalledClass - is the calling class when using a static method. (defined in October\Rain\Extension\ExtensionBase)
- $assetPath - specifies the relative path to the asset directory. (defined in Backend\Classes\ControllerBehavior)
- $assetUrlPath - specifies the public path to the asset directory. (defined in Backend\Classes\ControllerBehavior)
- $vars - is a list of variables to pass to the page. (defined in Backend\Classes\ControllerBehavior)
- $layout - to use for the view. (defined in Backend\Classes\ControllerBehavior)
- $suppressLayout - prevents the use of a layout. (defined in Backend\Classes\ControllerBehavior)
Protected Properties
protected array $listDefinitions
listDefinitions are keys for alias and value for configuration.
protected string $primaryDefinition
primaryDefinition list alias to use. Default: list
protected array $listConfig
listConfig are keys for alias and value for config objects.
protected Backend\Classes\WidgetBase[] $listWidgets
listWidgets reference to the list widget object.
protected Backend\Classes\WidgetBase[] $toolbarWidgets
toolbarWidgets reference to the toolbar widget objects.
protected Backend\Classes\WidgetBase[] $filterWidgets
filterWidgets reference to the filter widget objects.
protected array $requiredProperties
requiredProperties in the controller
protected array $requiredConfig
requiredConfig values that must exist when applying the primary config file.
- modelClass: Class name for the model
- list: List column definitions
protected array $actions
actions visible in context of the controller
Show inherited protected properties
Inherited Protected Properties
- $config - supplied. (defined in Backend\Classes\ControllerBehavior)
- $controller - reference. (defined in Backend\Classes\ControllerBehavior)
- $extensionHidden - are properties and methods that cannot be accessed. (defined in October\Rain\Extension\ExtensionBase)
- $assets - Collection of assets to display in the layout. (defined in Backend\Classes\ControllerBehavior)
- $assetBundles - Collection of combined and prioritized assets. (defined in Backend\Classes\ControllerBehavior)
- $assetDefaults - is the default attributes for assets. (defined in Backend\Classes\ControllerBehavior)
- $configPath - specifies a path to the config directory. (defined in Backend\Classes\ControllerBehavior)
- $viewPath - specifies a path to the views directory. (defined in Backend\Classes\ControllerBehavior)
- $layoutPath - specifies a path to the layout directory. (defined in Backend\Classes\ControllerBehavior)
- $viewPathGuessCache - remembers path guesses for performance. (defined in Backend\Classes\ControllerBehavior)
Public Methods
public __construct()
public __construct(Backend\Classes\Controller $controller): void
__construct the behavior
public static extendListColumns()
public static extendListColumns($callback): void
extendListColumns is a static helper for extending list columns.
public static extendListFilterScopes()
public static extendListFilterScopes($callback): void
extendListFilterScopes is a static helper for extending filter scopes.
public index()
public index(): void
index controller action
public index_onDelete()
public index_onDelete(): void
index_onDelete bulk deletes records.
public listAfterReorder()
public listAfterReorder(
October\Rain\Database\Model $record,
string|null $definition = null
): void
listAfterReorder is called after the list record structure is reordered
public listExtendColumns()
public listExtendColumns(Backend\Widgets\List $host): void
listExtendColumns is called after the list columns are defined.
public listExtendModel()
public listExtendModel(Model $model, $definition = null): Model
listExtendModel controller override: Extend supplied model
public listExtendQuery()
public listExtendQuery(
October\Rain\Database\Builder $query,
$definition = null
): void
listExtendQuery controller override: Extend the query used for populating the list after the default query is processed.
public listExtendQueryBefore()
public listExtendQueryBefore(
October\Rain\Database\Builder $query,
$definition = null
): void
listExtendQueryBefore controller override: Extend the query used for populating the list before the default query is processed.
public listExtendRecords()
public listExtendRecords(
Illuminate\Contracts\Pagination\LengthAwarePaginator|Illuminate\Database\Eloquent\Collection $records,
$definition = null
): void
listExtendRecords controller override: Extend the records used for populating the list after the query is processed.
public listExtendRefreshResults()
public listExtendRefreshResults(
Backend\Widgets\List $host,
array $result,
string $definition = null
): array
listExtendRefreshResults is called when the list is refreshed using AJAX, and should return an array of additional partial updates.
public listExtendSortColumn()
public listExtendSortColumn(
October\Rain\Database\Builder $query,
$sortColumn,
$sortDirection,
$definition = null
): void
listExtendSortColumn controller override: Customize the sort column and direction to include secondary sorting columns if necessary
public listFilterExtendQuery()
public listFilterExtendQuery(
October\Rain\Database\Builder $query,
array $scope
): void
listFilterExtendQuery controller override: Extend the query used for populating the filter options before the default query is processed.
public listFilterExtendScopes()
public listFilterExtendScopes(Backend\Widgets\Filter $host): void
listFilterExtendScopes is called after the filter scopes are defined.
public listGetConfig()
public listGetConfig($definition = null): object|null
listGetConfig returns the configuration used by this behavior. You may override this method in your controller as an alternative to defining a listConfig property.
public listGetFilterWidget()
public listGetFilterWidget($definition = null): Backend\Classes\WidgetBase
listGetFilterWidget returns the filter widget used by this behavior.
public listGetId()
public listGetId(string $suffix = null, $definition = null): string
listGetId returns a unique ID for the list widget used by this behavior. This is useful for dealing with identifiers in the markup.
<div id="<?= $this->listGetId()">...</div>
A suffix may be used passed as the first argument to reuse the identifier in other areas.
<button id="<?= $this->listGetId('button')">...</button>
public listGetToolbarWidget()
public listGetToolbarWidget($definition = null): Backend\Classes\WidgetBase
listGetToolbarWidget returns the toolbar widget used by this behavior.
public listGetWidget()
public listGetWidget($definition = null): Backend\Classes\WidgetBase
listGetWidget returns the widget used by this behavior.
public listInjectRowClass()
public listInjectRowClass(
Model $record,
string $definition = null
): string
listInjectRowClass returns a CSS class name for a list row (
public listMakePartial()
public listMakePartial(string $partial, array $params = []): string
listMakePartial is a controller accessor for making partials within this behavior.
public listOverrideColumnValue()
public listOverrideColumnValue(
Model $record,
string $columnName,
string $definition = null
): string
listOverrideColumnValue replaces a table column value (
public listOverrideHeaderValue()
public listOverrideHeaderValue(
string $columnName,
string $definition = null
): string
listOverrideHeaderValue replaces the entire table header contents (
public listOverrideRecordUrl()
public listOverrideRecordUrl(
October\Rain\Database\Model $record,
string|null $definition = null
): string|array|void
listOverrideRecordUrl overrides the record url for the given record
public listRefresh()
public listRefresh(string $definition = null): array
listRefresh refreshes the list container only, useful for returning in custom AJAX requests.
public listRender()
public listRender(string $definition = null): string
listRender renders the widget collection.
public makeList()
public makeList($definition = null): Backend\Classes\WidgetBase
makeList prepares the widgets used by this action
public makeLists()
public makeLists(): array
makeLists creates all the list widgets based on the definitions.
Inherited Public Methods
- addCss() - includes a StyleSheet asset to the asset list. (defined in Backend\Classes\ControllerBehavior)
- addCssBundle() - includes a CSS asset to the bundled combiner pipeline. (defined in Backend\Classes\ControllerBehavior)
- addJs() - includes a JavaScript asset to the asset list. (defined in Backend\Classes\ControllerBehavior)
- addJsBundle() - includes a JS asset to the bundled combiner pipeline. (defined in Backend\Classes\ControllerBehavior)
- addRss() - adds an RSS link asset to the asset list. Call $this->makeAssets(). (defined in Backend\Classes\ControllerBehavior)
- addViewPath() - prepends a path on the available view path locations. (defined in Backend\Classes\ControllerBehavior)
- beforeDisplay() - fires before the page is displayed and AJAX is executed. (defined in Backend\Classes\ControllerBehavior)
- combineAssets() - runs asset paths through the Asset Combiner. (defined in Backend\Classes\ControllerBehavior)
- extend() - this class with a closure. (defined in October\Rain\Extension\ExtensionBase)
- extensionApplyInitCallbacks() - (defined in October\Rain\Extension\ExtensionBase)
- extensionExtendCallback() - is a helper method for
::extend()static method. (defined in October\Rain\Extension\ExtensionBase) - extensionIsHiddenMethod() - (defined in October\Rain\Extension\ExtensionBase)
- extensionIsHiddenProperty() - (defined in October\Rain\Extension\ExtensionBase)
- flushAssets() - disables the use, and subsequent broadcast, of assets. This is useful. (defined in Backend\Classes\ControllerBehavior)
- getAssetPath() - locates a file based on it's definition. If the file starts with. (defined in Backend\Classes\ControllerBehavior)
- getAssetPaths() - returns an array of all registered asset paths. (defined in Backend\Classes\ControllerBehavior)
- getCalledExtensionClass() - (defined in October\Rain\Extension\ExtensionBase)
- getConfig() - is a safe accessor for configuration values. (defined in Backend\Classes\ControllerBehavior)
- getConfigPath() - locates a file based on it's definition. If the file starts with. (defined in Backend\Classes\ControllerBehavior)
- getViewPath() - locates a file based on its definition. The file name can be prefixed. (defined in Backend\Classes\ControllerBehavior)
- getViewPaths() - returns the active view path locations. (defined in Backend\Classes\ControllerBehavior)
- getWidget() - (defined in Backend\Classes\ControllerBehavior)
- guessConfigPath() - guesses the package path for the called class. (defined in Backend\Classes\ControllerBehavior)
- guessConfigPathFrom() - guesses the package path from a specified class. (defined in Backend\Classes\ControllerBehavior)
- guessViewPath() - guesses the package path for the called class. (defined in Backend\Classes\ControllerBehavior)
- guessViewPathFrom() - guesses the package path from a specified class, including. (defined in Backend\Classes\ControllerBehavior)
- hasAssetsDefined() - returns true if assets any have been added. (defined in Backend\Classes\ControllerBehavior)
- localMakeFileContents() - makeFileContents includes a file path using output buffering. (defined in Backend\Classes\ControllerBehavior)
- makeAssets() - outputs
<link>and<script>tags to load assets previously added with addJs and addCss method calls. (defined in Backend\Classes\ControllerBehavior) - makeConfig() - reads the contents of the supplied file and applies it to this object. (defined in Backend\Classes\ControllerBehavior)
- makeConfigFromArray() - makes a config object from an array, making the first. (defined in Backend\Classes\ControllerBehavior)
- makeFileContents() - makes all views in context of the controller, not the behavior. (defined in Backend\Classes\ControllerBehavior)
- makeFormWidget() - object with the supplied form field and widget configuration. (defined in Backend\Classes\ControllerBehavior)
- makeLayout() - renders a layout. (defined in Backend\Classes\ControllerBehavior)
- makeLayoutPartial() - renders a layout partial. (defined in Backend\Classes\ControllerBehavior)
- makePartial() - renders a partial file contents located in the views folder. (defined in Backend\Classes\ControllerBehavior)
- makeView() - loads a view with the name specified. Applies layout if its name is provided. (defined in Backend\Classes\ControllerBehavior)
- makeViewContent() - renders supplied contents inside a layout. (defined in Backend\Classes\ControllerBehavior)
- makeWidget() - object with the supplied configuration file. (defined in Backend\Classes\ControllerBehavior)
- mergeConfig() - merges two configuration sources, either prepared or not, and returns. (defined in Backend\Classes\ControllerBehavior)
- resetSession() - Resets all session data related to this widget. (defined in Backend\Classes\ControllerBehavior)
- setConfig() - sets the configuration values. (defined in Backend\Classes\ControllerBehavior)
Protected Methods
protected createModel()
protected createModel(): October\Rain\Database\Model
createModel is an internal method used to prepare the list model object.
protected listCanDeleteRecords()
protected listCanDeleteRecords(): bool
listCanDeleteRecords determines if records can be deleted from the list
protected makeListStructureConfig()
protected makeListStructureConfig($widgetConfig, $config): object|null
Show inherited protected methods
Inherited Protected Methods
- combineBundledAssets() - spins over every bundle definition and combines them to an asset. (defined in Backend\Classes\ControllerBehavior)
- controllerMethodExists() - (defined in Backend\Classes\ControllerBehavior)
- extensionHideMethod() - (defined in October\Rain\Extension\ExtensionBase)
- extensionHideProperty() - (defined in October\Rain\Extension\ExtensionBase)
- getAssetEntryBuildPath() - Internal helper, attaches a build code to an asset path. (defined in Backend\Classes\ControllerBehavior)
- getAssetScheme() - is an internal helper to get the asset scheme. (defined in Backend\Classes\ControllerBehavior)
- getConfigValueFrom() - will apply the config getter convention. (defined in Backend\Classes\ControllerBehavior)
- getLocalPath() - converts a relative path to a local path. (defined in Backend\Classes\ControllerBehavior)
- getSession() - Retrieves a widget related key/value pair from session data. (defined in Backend\Classes\ControllerBehavior)
- handleViewException() - handles a view exception. (defined in Backend\Classes\ControllerBehavior)
- hideAction() - protects a public method from being available as an controller action. (defined in Backend\Classes\ControllerBehavior)
- makeSessionId() - Returns a unique session identifier for this widget and controller action. (defined in Backend\Classes\ControllerBehavior)
- processAssetAttributes() - (defined in Backend\Classes\ControllerBehavior)
- putSession() - Saves a widget related key/value pair in to session data. (defined in Backend\Classes\ControllerBehavior)
- removeDuplicateAssets() - removes duplicate and global assets from the entire collection. (defined in Backend\Classes\ControllerBehavior)
- renderAssetAttributes() - takes an asset definition and returns the necessary HTML output. (defined in Backend\Classes\ControllerBehavior)
Latest from the blog
eCommerce for October CMS v4.2 is here!
We're excited to announce October CMS version 4.2, and this one is special. Alongside a major modernization of the frontend architecture, we're launching Meloncart, a full eCommerce platform built natively on October CMS.
- October CMS
- Home
- Features
- Hosting
- Roadmap & Portal
- Terms & Conditions
- Contact Us
- About
- Blog
- Discover More
- My Account
- Plugins
- Themes
- Partners
- Support
- Premium Support
- Documentation
- Help Center
- Forum
- Guidelines
- Quality Guidelines
- Developer Guide