-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Backend
- Behaviors
- ListController
Backend\Behaviors\ListController
Source: ~/modules/backend/behaviors/ListController.php
Extends:
Adds features for working with backend lists.
This behavior is implemented in the controller like so:
public $implement = [ 'Backend.Behaviors.ListController', ]; 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.
Public properties
There are no public properties in the class.
Show inherited public properties
Inherited public properties
- public static string $extendableStaticCalledClass - defined in October\Rain\Extension\ExtensionBase. The calling class when using a static method.
- public string $assetPath - defined in Backend\Classes\ControllerBehavior. Specifies a path to the asset directory.
- public array $vars - defined in Backend\Classes\ControllerBehavior. A list of variables to pass to the page.
- public string $layout - defined in Backend\Classes\ControllerBehavior. Layout to use for the view.
- public bool $suppressLayout - defined in Backend\Classes\ControllerBehavior. Prevents the use of a layout.
Protected properties
protected array $listDefinitions
List definitions, keys for alias and value for configuration.
protected string $primaryDefinition
The primary list alias to use. Default: list
protected array $listConfig
List configuration, keys for alias and value for config objects.
protected Backend\Classes\WidgetBase $listWidgets
Reference to the list widget object.
protected Backend\Classes\WidgetBase $toolbarWidgets
Reference to the toolbar widget objects.
protected Backend\Classes\WidgetBase $filterWidgets
Reference to the filter widget objects.
protected $requiredProperties
Properties that must exist in the controller using this behavior.
protected array $requiredConfig
Configuration values that must exist when applying the primary config file.
- modelClass: Class name for the model
- list: List column definitions
protected array $actions
Visible actions in context of the controller
Show inherited protected properties
Inherited protected properties
- protected array $config - defined in Backend\Classes\ControllerBehavior. Supplied configuration.
- protected Backend\Classes\Controller $controller - defined in Backend\Classes\ControllerBehavior. Reference to the back end controller.
- protected static array $extensionCallbacks - defined in October\Rain\Extension\ExtensionBase. Used to extend the constructor of an extension class.
- protected $extensionHidden - defined in October\Rain\Extension\ExtensionBase.
- protected array $assets - defined in Backend\Classes\ControllerBehavior. Collection of assets to display in the layout.
- protected string $configPath - defined in Backend\Classes\ControllerBehavior. Specifies a path to the config directory.
- protected string|array $viewPath - defined in Backend\Classes\ControllerBehavior. Specifies a path to the views directory.
- protected string $layoutPath - defined in Backend\Classes\ControllerBehavior. Specifies a path to the layout directory.
Public methods
public void __construct(Backend\Classes\Controller $controller)
Behavior constructor
Parameters
- Backend\Classes\Controller $controller
public static void extendListColumns(callable $callback)
Static helper for extending list columns.
Parameters
- callable $callback
public static void extendListFilterScopes(callable $callback)
Static helper for extending filter scopes.
Parameters
- callable $callback
public void index()
Index Controller action.
public void index_onDelete()
Bulk delete records.
public void listExtendColumns(Backend\Widgets\List $host)
Called after the list columns are defined.
Parameters
- Backend\Widgets\List $host - The hosting list widget
public Model listExtendModel(Model $model, $definition=NULL)
Controller override: Extend supplied model
Parameters
- Model $model
- $definition
public void listExtendQuery(October\Rain\Database\Builder $query, $definition=NULL)
Controller override: Extend the query used for populating the list after the default query is processed.
Parameters
- October\Rain\Database\Builder $query
- $definition
public void listExtendQueryBefore(October\Rain\Database\Builder $query, $definition=NULL)
Controller override: Extend the query used for populating the list before the default query is processed.
Parameters
- October\Rain\Database\Builder $query
- $definition
public void listExtendRecords(Illuminate\Contracts\Pagination\LengthAwarePaginator|Illuminate\Database\Eloquent\Collection $records, $definition=NULL)
Controller override: Extend the records used for populating the list after the query is processed.
Parameters
- Illuminate\Contracts\Pagination\LengthAwarePaginator|Illuminate\Database\Eloquent\Collection $records
- $definition
public void listFilterExtendQuery(October\Rain\Database\Builder $query, array $scope)
Controller override: Extend the query used for populating the filter options before the default query is processed.
Parameters
- October\Rain\Database\Builder $query
- array $scope
public void listFilterExtendScopes(Backend\Widgets\Filter $host)
Called after the filter scopes are defined.
Parameters
- Backend\Widgets\Filter $host - The hosting filter widget
public Backend\Classes\WidgetBase listGetConfig($definition=NULL)
Returns the configuration used by this behavior.
Parameters
- $definition
public Backend\Classes\WidgetBase listGetWidget($definition=NULL)
Returns the widget used by this behavior.
Parameters
- $definition
public string listInjectRowClass(Model $record, string $definition=NULL)
Returns a CSS class name for a list row (
Parameters
- Model $record - The populated model used for the column
- string $definition - List definition (optional)
public string listMakePartial(string $partial, array $params=array())
Controller accessor for making partials within this behavior.
Parameters
- string $partial
- array $params
public string listOverrideColumnValue(Model $record, string $columnName, string $definition=NULL)
Replace a table column value (
Parameters
- Model $record - The populated model used for the column
- string $columnName - The column name to override
- string $definition - List definition (optional)
public string listOverrideHeaderValue(string $columnName, string $definition=NULL)
Replace the entire table header contents (
Parameters
- string $columnName - The column name to override
- string $definition - List definition (optional)
public array listRefresh(string $definition=NULL)
Refreshes the list container only, useful for returning in custom AJAX requests.
Parameters
- string $definition - Optional list definition.
public string listRender(string $definition=NULL)
Renders the widget collection.
Parameters
- string $definition - Optional list definition.
public void makeList($definition=NULL)
Prepare the widgets used by this action
Parameters
- $definition
public array makeLists()
Creates all the list widgets based on the definitions.
Inherited public methods
- public void addCss(string $name, array $attributes=array()) - defined in Backend\Classes\ControllerBehavior. Adds StyleSheet asset to the asset list. Call $this->makeAssets() in a view.
- public void addJs(string $name, array $attributes=array()) - defined in Backend\Classes\ControllerBehavior. Adds JavaScript asset to the asset list. Call $this->makeAssets() in a view.
- public void addRss(string $name, array $attributes=array()) - defined in Backend\Classes\ControllerBehavior. Adds an RSS link asset to the asset list. Call $this->makeAssets() in a view.
- public void addViewPath(string|array $path) - defined in Backend\Classes\ControllerBehavior. Prepends a path on the available view path locations.
- public string combineAssets(array $assets, string $localPath='') - defined in Backend\Classes\ControllerBehavior. Run the provided assets through the Asset Combiner.
- public static void extend($callback) - defined in October\Rain\Extension\ExtensionBase.
- public void extensionApplyInitCallbacks() - defined in October\Rain\Extension\ExtensionBase.
- public static void extensionExtendCallback(callable $callback) - defined in October\Rain\Extension\ExtensionBase. Helper method for
::extend()
static method. - public void extensionIsHiddenField($name) - defined in October\Rain\Extension\ExtensionBase.
- public void extensionIsHiddenMethod($name) - defined in October\Rain\Extension\ExtensionBase.
- public void flushAssets() - defined in Backend\Classes\ControllerBehavior. Disables the use, and subequent broadcast, of assets. This is useful.
- public string getAssetPath(string $fileName, string $assetPath=NULL) - defined in Backend\Classes\ControllerBehavior. Locates a file based on it's definition. If the file starts with.
- public array getAssetPaths() - defined in Backend\Classes\ControllerBehavior. Returns an array of all registered asset paths.
- public static void getCalledExtensionClass() - defined in October\Rain\Extension\ExtensionBase.
- public string getConfig(string $name=NULL, mixed $default=NULL) - defined in Backend\Classes\ControllerBehavior. Safe accessor for configuration values.
- public string getConfigPath(string $fileName, mixed $configPath=NULL) - defined in Backend\Classes\ControllerBehavior. Locates a file based on it's definition. If the file starts with.
- public string getViewPath(string $fileName, mixed $viewPath=NULL) - defined in Backend\Classes\ControllerBehavior. Locates a file based on its definition. The file name can be prefixed with a.
- public array getViewPaths() - defined in Backend\Classes\ControllerBehavior. Returns the active view path locations.
- public string guessConfigPath(string $suffix='') - defined in Backend\Classes\ControllerBehavior. Guess the package path for the called class.
- public string guessConfigPathFrom(string $class, string $suffix='') - defined in Backend\Classes\ControllerBehavior. Guess the package path from a specified class.
- public string guessViewPath(string $suffix='', bool $isPublic=false) - defined in Backend\Classes\ControllerBehavior. Guess the package path for the called class.
- public string guessViewPathFrom(string $class, string $suffix='', bool $isPublic=false) - defined in Backend\Classes\ControllerBehavior. Guess the package path from a specified class.
- public bool hasAssetsDefined() - defined in Backend\Classes\ControllerBehavior. Returns true if assets any have been added.
- public string localMakeFileContents(string $filePath, array $extraParams=array()) - defined in Backend\Classes\ControllerBehavior. Includes a file path using output buffering.
- public string makeAssets(string $type=NULL) - defined in Backend\Classes\ControllerBehavior. Outputs
<link>
and<script>
tags to load assets previously added with addJs and addCss method calls. - public array|stdClass makeConfig(array $configFile=array(), array $requiredConfig=array()) - defined in Backend\Classes\ControllerBehavior. Reads the contents of the supplied file and applies it to this object.
- public stdClass makeConfigFromArray(array $configArray=array()) - defined in Backend\Classes\ControllerBehavior. Makes a config object from an array, making the first level keys properties of a new object.
- public string makeFileContents(string $filePath, array $extraParams=array()) - defined in Backend\Classes\ControllerBehavior. Makes all views in context of the controller, not the behavior.
- public Backend\Classes\FormWidgetBase makeFormWidget(string $class, mixed $fieldConfig=array(), array $widgetConfig=array()) - defined in Backend\Classes\ControllerBehavior. Makes a form widget object with the supplied form field and widget configuration.
- public mixed makeLayout(string $name=NULL, array $params=array(), bool $throwException=true) - defined in Backend\Classes\ControllerBehavior. Render a layout.
- public string makeLayoutPartial(string $partial, array $params=array()) - defined in Backend\Classes\ControllerBehavior. Renders a layout partial.
- public mixed makePartial(string $partial, array $params=array(), bool $throwException=true) - defined in Backend\Classes\ControllerBehavior. Render a partial file contents located in the views folder.
- public string makeView(string $view) - defined in Backend\Classes\ControllerBehavior. Loads a view with the name specified. Applies layout if its name is provided by the parent object.
- public string makeViewContent(string $contents, string $layout=NULL) - defined in Backend\Classes\ControllerBehavior. Renders supplied contents inside a layout.
- public Backend\Classes\WidgetBase makeWidget(string $class, array $widgetConfig=array()) - defined in Backend\Classes\ControllerBehavior. Makes a widget object with the supplied configuration file.
- public stdClass mergeConfig(mixed $configA, mixed $configB) - defined in Backend\Classes\ControllerBehavior. Merges two configuration sources, either prepared or not, and returns.
- public void resetSession() - defined in Backend\Classes\ControllerBehavior. Resets all session data related to this widget.
- public void setConfig(mixed $config, array $required=array()) - defined in Backend\Classes\ControllerBehavior. Sets the configuration values.
Protected methods
Show inherited protected methods
Inherited protected methods
- protected void addAsset(string $type, string $path, array $attributes) - defined in Backend\Classes\ControllerBehavior. Adds the provided asset to the internal asset collections.
- protected bool controllerMethodExists(string $methodName) - defined in Backend\Classes\ControllerBehavior. Returns true in case if a specified method exists in the extended controller.
- protected void extensionHideField($name) - defined in October\Rain\Extension\ExtensionBase.
- protected void extensionHideMethod($name) - defined in October\Rain\Extension\ExtensionBase.
- protected string getAssetEntryBuildPath(array $asset) - defined in Backend\Classes\ControllerBehavior. Internal helper, attaches a build code to an asset path.
- protected string getAssetScheme(string $asset) - defined in Backend\Classes\ControllerBehavior. Internal helper, get asset scheme.
- protected void getLocalPath($relativePath) - defined in Backend\Classes\ControllerBehavior.
- protected string getSession(string $key=NULL, string $default=NULL) - defined in Backend\Classes\ControllerBehavior. Retrieves a widget related key/value pair from session data.
- protected void handleViewException(Exception $e, int $obLevel) - defined in Backend\Classes\ControllerBehavior. Handle a view exception.
- protected void hideAction(mixed $methodName) - defined in Backend\Classes\ControllerBehavior. Protects a public method from being available as an controller action.
- protected string makeSessionId() - defined in Backend\Classes\ControllerBehavior. Returns a unique session identifier for this widget and controller action.
- protected void putSession(string $key, string $value) - defined in Backend\Classes\ControllerBehavior. Saves a widget related key/value pair in to session data.
- protected void removeDuplicates() - defined in Backend\Classes\ControllerBehavior. Removes duplicate assets from the entire collection.