### install() Source: https://docs.craftcms.com/api/v5/craft-base-plugininterface.html Installs the plugin. ```APIDOC ## install() ### Description Installs the plugin. ``` -------------------------------- ### install() Source: https://docs.craftcms.com/api/v5/craft-base-plugininterface.html Installs the plugin into the Craft CMS instance. ```APIDOC ## install() ### Description Installs the plugin. ### Method (Not specified, assumed to be called internally by Craft CMS) ### Endpoint (Not applicable, this is an interface method) ### Parameters (None specified) ### Returns (None specified) ``` -------------------------------- ### install() Source: https://docs.craftcms.com/api/v5/craft-services-composer.html Installs a given set of packages with Composer. If no requirements are specified, it runs `composer install`. ```APIDOC ## install($requirements, $callback) ### Description Installs a given set of packages with Composer. ### Arguments * `$requirements` (array, null) – Package name/version pairs, or set to null to run the equivalent of `composer install` * `$callback` (callable, null) – The callback that should be passed to `Process::run()`. ### Throws * Throwable if something goes wrong ### View source [source link] ``` -------------------------------- ### PasskeySetupAsset JS Property Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-passkeysetup-passkeysetupasset.html Example of how to specify JavaScript files for the PasskeySetupAsset bundle. ```php public $js = [ 'PasskeySetup.js', ]; ``` -------------------------------- ### Primary Connection Configuration Example Source: https://docs.craftcms.com/api/v5/craft-db-primaryreplicatrait.html Example of a primary connection configuration that can be merged with primary configurations. This example sets the username, password, and a smaller connection timeout. ```php [ 'username' => 'primary', 'password' => 'primary', 'attributes' => [ // use a smaller connection timeout PDO::ATTR_TIMEOUT => 10, ], ] ``` -------------------------------- ### Install Plugin Source: https://docs.craftcms.com/api/v5/craft-controllers-pluginstore-installcontroller.html Installs a plugin from the Plugin Store. ```APIDOC ## POST actionCraftInstall ### Description Installs the plugin from the Plugin Store. ### Method POST ### Endpoint /plugin-store/install/install ### Parameters #### Query Parameters - **pluginHandle** (string) - Required - The handle of the plugin to install. ``` -------------------------------- ### Replica Connection Configuration Example Source: https://docs.craftcms.com/api/v5/craft-db-primaryreplicatrait.html Example of a replica connection configuration that can be merged with replica configurations. This example sets the username, password, and a smaller connection timeout. ```php [ 'username' => 'replica', 'password' => 'replica', 'attributes' => [ // use a smaller connection timeout PDO::ATTR_TIMEOUT => 10, ], ] ``` -------------------------------- ### UserPhotoAsset Bundle Dependencies Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-userphoto-userphotoasset.html Example demonstrating how to specify other asset bundles that UserPhotoAsset depends on. This ensures required assets are loaded. ```php public $depends = [ 'craft\web\assets\cp\CpAsset', 'craft\web\assets\fileupload\FileUploadAsset', ]; ``` -------------------------------- ### actionMethodSetupHtml() Source: https://docs.craftcms.com/api/v5/craft-controllers-authcontroller.html Returns the HTML for an authentication method’s setup slideout. Used for initiating the setup process for new authentication methods. ```APIDOC ## actionMethodSetupHtml() ### Description Returns the HTML for an authentication method’s setup slideout. ### Method GET (inferred) ### Endpoint /method-setup-html (inferred) ### Parameters None explicitly documented. ### Response #### Success Response (200) - **response** (yii\web\Response) - The response object containing the HTML for the authentication method setup slideout. ``` -------------------------------- ### Example RecentEntriesAsset JavaScript Files Source: https://docs.craftcms.com/api/v5/craft-web-assets-recententries-recententriesasset.html This example demonstrates how to specify the JavaScript files to be included in the RecentEntriesAsset bundle. ```php public $js = [ 'RecentEntriesWidget.js', ]; ``` -------------------------------- ### Example: Registering JavaScript Files Source: https://docs.craftcms.com/api/v5/craft-web-assets-matrix-matrixasset.html This example demonstrates how to specify JavaScript files to be included in the asset bundle. It lists 'MatrixInput.js' as a local asset. ```php public $js = [ 'MatrixInput.js', ]; ``` -------------------------------- ### CraftSupportAsset Source Path Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-craftsupport-craftsupportasset.html Example of setting the sourcePath for the CraftSupportAsset bundle. This is used when source asset files are not in a Web-accessible directory. ```php public $sourcePath = '__DIR__ . \'/dist '; ``` -------------------------------- ### installPlugin() Source: https://docs.craftcms.com/api/v5/craft-test-craft.html Installs a specified plugin. ```APIDOC ## installPlugin() ### Description Installs a specified plugin. ### Arguments * `$plugin` (array) ### Throws * yii\base\InvalidConfigException * Throwable * craft\errors\InvalidPluginException ``` -------------------------------- ### CraftSupportAsset CSS Dependency Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-craftsupport-craftsupportasset.html Example of how to define CSS files for the CraftSupportAsset bundle. Only forward slashes should be used as directory separators. ```php public $css = [ 'css/CraftSupportWidget.css', ]; ``` -------------------------------- ### CraftSupportAsset Bundle Dependencies Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-craftsupport-craftsupportasset.html Example of defining dependencies for the CraftSupportAsset bundle. This ensures that other required asset bundles are loaded first. ```php public $depends = [ 'craft\web\assets\cp\CpAsset::class', ]; ``` ```php public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', ]; ``` -------------------------------- ### actionList Source: https://docs.craftcms.com/api/v5/craft-console-controllers-plugincontroller.html Lists all installed plugins. ```APIDOC ## actionList ### Description Lists all plugins. ### Method GET ### Endpoint `/plugin` ### Response #### Success Response (200) - **integer** - Returns an integer indicating the result of the operation. ``` -------------------------------- ### UserPhotoAsset CSS Dependency Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-userphoto-userphotoasset.html Example of how to define CSS dependencies for the UserPhotoAsset bundle. Ensure forward slashes are used for directory separators. ```php public $css = [ 'css/UserPhotoInput.css', ]; ``` -------------------------------- ### Eager Loading Map Example Source: https://docs.craftcms.com/api/v5/craft-fields-baserelationfield.html Provides an example of an eager loading map for relations, including source-target mappings and optional criteria. ```php return [ 'map' => [ ['source' => 1, 'target' => 10], ['source' => 1, 'target' => 11], ['source' => 2, 'target' => 12], ], 'criteria' => ['status' => 'live'], 'defaultSort' => ['dateCreated' => SORT_DESC] ]; ``` -------------------------------- ### NewUsersAsset JS Property Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-newusers-newusersasset.html Example of specifying JavaScript files to be included in the NewUsersAsset bundle. Supports local paths and external URLs. ```php public $js = [ 'NewUsersWidget.js', ]; ``` -------------------------------- ### CraftSupportAsset JavaScript Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-craftsupport-craftsupportasset.html Example of how to define JavaScript files for the CraftSupportAsset bundle. Supports absolute URLs, relative paths, and arrays with jsOptions overrides. ```php public $js = [ 'CraftSupportWidget.js', ]; ``` -------------------------------- ### actionInstallPlugin Source: https://docs.craftcms.com/api/v5/craft-controllers-pluginscontroller.html Installs a plugin in Craft CMS. ```APIDOC ## POST /install-plugin ### Description Installs a plugin. ### Method POST ### Endpoint /install-plugin ### Response #### Success Response (200) - **response** (yii\web\Response | null) - The response from the action. ``` -------------------------------- ### UserPhotoAsset JavaScript Dependency Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-userphoto-userphotoasset.html Example of how to define JavaScript dependencies for the UserPhotoAsset bundle. Supports external URLs, relative paths, and options for registration. ```php public $js = [ 'UserPhotoInput.js', ]; ``` -------------------------------- ### setupDb() Source: https://docs.craftcms.com/api/v5/craft-test-craft.html Sets up the database for testing. ```APIDOC ## setupDb() ### Description Sets up the database for testing. ### Returns void ``` -------------------------------- ### Get All Config Settings Source: https://docs.craftcms.com/api/v5/craft-services-config.html Retrieve all configuration settings for a specific category. For example, to get all general settings. ```php Craft::$app->config->getConfigSettings('general'); ``` -------------------------------- ### setupDb() Source: https://docs.craftcms.com/api/v5/craft-test-craft.html Sets up the database connection for testing purposes. ```APIDOC ### `setupDb()` #### Throws * Throwable ``` -------------------------------- ### Set Default Week Start Day Source: https://docs.craftcms.com/api/v5/craft-config-generalconfig.html Specify the default starting day of the week for new users. The example sets it to Sunday (0). ```php ->defaultWeekStartDay(0) ``` ```shell CRAFT_DEFAULT_WEEK_START_DAY=0 ``` -------------------------------- ### actionValidateAccount Source: https://docs.craftcms.com/api/v5/craft-controllers-installcontroller.html Validates the user account credentials provided during the installation or setup process. ```APIDOC ## POST /install/validate-account ### Description Validates the user account credentials entered by the user. ### Method POST ### Endpoint /install/validate-account ### Parameters None explicitly documented, but likely expects account credentials in the request body. ### Response #### Success Response (200) - **yii\web\Response**: Indicates whether the account credentials are valid. #### Response Example (Response content indicates validation status) ``` -------------------------------- ### Get Field Status Example Source: https://docs.craftcms.com/api/v5/craft-base-fieldinterface.html Returns the status of a field for a given element, including an AttributeStatus case and a descriptive label. This is useful for tracking field modifications. ```php return [ AttributeStatus::Modified, 'The field has been modified.' ]; ``` -------------------------------- ### init() Source: https://docs.craftcms.com/api/v5/craft-console-application.html Initialize the application. ```APIDOC ## init() ### Description Initialize the application. ### Method (Not specified, likely internal) ``` -------------------------------- ### actionCraftInstall() Source: https://docs.craftcms.com/api/v5/craft-controllers-pluginstore-installcontroller.html Installs the plugin. This method is part of the public API for interacting with the Plugin Store. ```APIDOC ## POST /actions/plugin-store/install ### Description Installs a plugin via the Plugin Store. ### Method POST ### Endpoint /actions/plugin-store/install ### Returns yii\web\Response ``` -------------------------------- ### get Source: https://docs.craftcms.com/api/v5/craft-elements-entry.html Placeholder for get method. ```APIDOC ## get ### Description Placeholder for get method. ### Method GET (assumed) ### Endpoint /elements/get (assumed) ``` -------------------------------- ### prepare() Source: https://docs.craftcms.com/api/v5/craft-db-activequery.html Prepares for building SQL. ```APIDOC ## prepare() ### Description Prepares for building SQL. ### Method Not applicable (SDK method) ### Parameters None explicitly documented. ``` -------------------------------- ### actionInstall Source: https://docs.craftcms.com/api/v5/craft-console-controllers-plugincontroller.html Installs a plugin using its handle and edition. ```APIDOC ## actionInstall ### Description Installs a plugin. ### Method POST ### Endpoint `/plugin/` ### Parameters #### Path Parameters - **handle** (string) - Required - The plugin handle. #### Request Body - **edition** (string) - Required - The edition of the plugin to install. ``` -------------------------------- ### getSetupHtml() Source: https://docs.craftcms.com/api/v5/craft-auth-methods-authmethodinterface.html Returns the HTML for the authentication method’s setup slideout. After enabling the method, call `showSuccess()` on the slideout and `Craft.authMethodSetup.refresh()` to update the main window. ```APIDOC ## getSetupHtml(string $containerId) Returns the HTML for the authentication method’s setup slideout. Once the method is enabled for the user, call the slideout’s `showSuccess()` method to display a success message, and call `Craft.authMethodSetup.refresh()` to refresh the method’s info and actions in the main window. ### JavaScript Example ```javascript Craft::$app->view->registerJsWithVars(fn($containerId, $class) => <<request->getQueryParam('foo'); // get $_GET['foo']['bar'], if it exists $bar = Craft::$app->request->getQueryParam('foo.bar'); ?> ``` ```twig {# get $_GET['foo'], if it exists #} {% set foo = craft.app.request.getQueryParam('foo') %} {# get $_GET['foo']['bar'], if it exists #} {% set bar = craft.app.request.getQueryParam('foo.bar') %} ``` -------------------------------- ### Composer Install Dependencies Source: https://docs.craftcms.com/api/v5/craft-controllers-pluginstore-installcontroller.html Installs Composer dependencies for a plugin. ```APIDOC ## POST actionComposerInstall ### Description Installs Composer dependencies for the plugin. ### Method POST ### Endpoint /plugin-store/install/composer-install ### Parameters #### Query Parameters - **pluginHandle** (string) - Required - The handle of the plugin for which to install dependencies. ``` -------------------------------- ### Registering JavaScript for Setup Slideout Success Source: https://docs.craftcms.com/api/v5/craft-auth-methods-totp.html Registers JavaScript to be executed after the setup slideout is shown. It calls `showSuccess()` on the slideout instance and refreshes the auth method setup. ```php Craft::$app->view->registerJsWithVars(fn($containerId, $class) => <<allowUpdates(false) ``` -------------------------------- ### createFilesystem() Source: https://docs.craftcms.com/api/v5/craft-services-fs.html Creates a new filesystem instance from a given configuration. This can be a class string or an array containing the type and settings. ```APIDOC ## `createFilesystem()` ### Description Creates a filesystem from a given config. ### Method `createFilesystem(string|array $config)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Arguments * `$config` (class-string|array) – The filesystem’s class name, or its config, with a `type` value and optionally a `settings` value ### Returns `craft\services\T` – The filesystem ``` -------------------------------- ### Object Initialization and Instance Methods Source: https://docs.craftcms.com/api/v5/craft-elements-address.html Methods for initializing objects and obtaining static instances. ```APIDOC ## Object Initialization and Instance Methods ### init() Initializes the object. ### instance() Returns static class instance, which can be used to obtain meta information. ``` -------------------------------- ### between() Source: https://docs.craftcms.com/api/v5/craft-helpers-stringhelper.html Extracts the substring found between two delimiters (start and end). An optional offset can specify the starting point for the search. ```APIDOC ## between() ### Description Returns the substring between $start and $end, if found, or an empty string. An optional offset may be supplied from which to begin the search for the start string. ### Arguments * `$str` (string) – The string to search. * `$start` (string) – Delimiter marking the start of the substring. * `$end` (string) – Delimiter marking the end of the substring. * `$offset` (integer, null) – Index from which to begin the search. Defaults to 0. ### Returns string – The resulting string. ``` -------------------------------- ### Get Config File Path Source: https://docs.craftcms.com/api/v5/craft-services-config.html Get the full path to a configuration file. Specify the filename without the .php extension. ```php Craft::$app->config->getConfigFilePath('general'); ``` -------------------------------- ### AssetIndexesAsset Depends Property Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-assetindexes-assetindexesasset.html Example of how to define the dependencies for the AssetIndexesAsset bundle. This ensures that required assets from other bundles are loaded. ```php public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', ]; ``` -------------------------------- ### open() Source: https://docs.craftcms.com/api/v5/craft-db-connection.html Establishes a connection to the database. If a connection already exists, this method does nothing. ```APIDOC ## open() ### Description Establishes a DB connection. It does nothing if a DB connection has already been established. ### Throws * craft\errors\DbConnectException if there are any issues * Throwable ``` -------------------------------- ### Component Example Public Methods Source: https://docs.craftcms.com/api/v5/craft-test-mockclasses-components-componentexample.html This section details the public methods of the Component Example class, including their descriptions and usage. ```APIDOC ## Public Methods This section details the public methods of the Component Example class. ### `__call()` **Description**: Calls the named method which is not a class method. ### `__clone()` **Description**: This method is called after the object is created by cloning an existing one. ### `__construct()` **Description**: Constructor for the Component Example class. ### `__get()` **Description**: Returns the value of a component property. ### `__isset()` **Description**: Checks if a property is set, i.e. defined and not null. ### `__set()` **Description**: Sets the value of a component property. ### `__unset()` **Description**: Sets a component property to be null. ### `activeAttributes()` **Description**: Returns the attribute names that are subject to validation in the current scenario. ### `addError()` **Description**: Adds a new error to the specified attribute. ### `addErrors()` **Description**: Adds a list of errors. ### `addModelErrors()` **Description**: Adds errors from another model, with a given attribute name prefix. ### `afterValidate()` **Description**: This method is invoked after validation ends. ### `attachBehavior()` **Description**: Attaches a behavior to this component. ### `attachBehaviors()` **Description**: Attaches a list of behaviors to the component. ### `attributeHints()` **Description**: Returns the attribute hints. ### `attributeLabels()` **Description**: Returns the attribute labels. ### `attributes()` **Description**: Returns the list of attribute names. ### `beforeValidate()` **Description**: This method is invoked before validation starts. ### `behaviors()` **Description**: Returns a list of behaviors that this component should behave as. ### `canGetProperty()` **Description**: Returns a value indicating whether a property can be read. ### `canSetProperty()` **Description**: Returns a value indicating whether a property can be set. ### `className()` **Description**: Returns the fully qualified name of this class. ### `clearErrors()` **Description**: Removes errors for all attributes or a single attribute. ### `createValidators()` **Description**: Creates validator objects based on the validation rules specified in rules(). ### `datetimeAttributes()` **Description**: Returns the names of any attributes that should hold DateTime values. ### `detachBehavior()` **Description**: Detaches a behavior from the component. ### `detachBehaviors()` **Description**: Detaches all behaviors from the component. ### `displayName()` **Description**: Placeholder for display name functionality. ### `ensureBehaviors()` **Description**: Makes sure that the behaviors declared in behaviors() are attached to this component. ### `extraFields()` **Description**: Returns the list of fields that can be expanded further and returned by toArray(). ### `fields()` **Description**: Returns the list of fields that should be returned by default by toArray() when no specific fields are specified. ### `formName()` **Description**: Returns the form name that this model class should use. ### `generateAttributeLabel()` **Description**: Generates a user friendly attribute label based on the give attribute name. ### `getActiveValidators()` **Description**: Returns the validators applicable to the current scenario. ### `getAttributeHint()` **Description**: Returns the text hint for the specified attribute. ### `getAttributeLabel()` **Description**: Returns the text label for the specified attribute. ### `getAttributes()` **Description**: Returns attribute values. ### `getBehavior()` **Description**: Returns the named behavior object. ### `getBehaviors()` **Description**: Returns all behaviors attached to this component. ### `getErrorSummary()` **Description**: Returns the errors for all attributes as a one-dimensional array. ### `getErrors()` **Description**: Retrieves errors associated with the model. ### `getFirstError()` **Description**: Returns the first error of the specified attribute. ### `getFirstErrors()` **Description**: Returns the first error of every attribute in the model. ### `getIterator()` **Description**: Returns an iterator for traversing the attributes in the model. ### `getScenario()` **Description**: Returns the scenario that this model is used in. ### `getValidators()` **Description**: Returns all the validators declared in rules(). ### `hasErrors()` **Description**: Returns a value indicating whether there is any validation error. ### `hasEventHandlers()` **Description**: Returns a value indicating whether there is any handler attached to the named event. ### `hasMethod()` **Description**: Returns a value indicating whether a method is defined. ### `hasProperty()` **Description**: Returns a value indicating whether a property is defined for this component. ### `init()` **Description**: Initializes the object. ### `instance()` **Description**: Returns static class instance, which can be used to obtain meta information. ### `isActiveAttribute()` **Description**: Returns a value indicating whether the attribute is active in the current scenario. ### `isAttributeRequired()` **Description**: Returns a value indicating whether the attribute is required. ### `isAttributeSafe()` **Description**: Returns a value indicating whether the attribute is safe for massive assignments. ### `isSelectable()` **Description**: Returns whether the component should be selectable in component Type selects. ### `load()` **Description**: Populates the model with input data. ### `loadMultiple()` **Description**: Populates a set of models with the data from end user. ### `off()` **Description**: Detaches an existing event handler from this component. ### `offsetExists()` **Description**: Returns whether there is an element at the specified offset. ### `offsetGet()` **Description**: Returns the element at the specified offset. ### `offsetSet()` **Description**: Sets the element at the specified offset. ### `offsetUnset()` **Description**: Sets the element value at the specified offset to null. ### `on()` **Description**: Attaches an event handler to an event. ### `onUnsafeAttribute()` **Description**: This method is invoked when an unsafe attribute is being massively assigned. ### `rules()` **Description**: Returns the validation rules for attributes. ### `safeAttributes()` **Description**: Returns the attribute names that are safe to be massively assigned in the current scenario. ### `scenarios()` **Description**: Returns a list of scenarios and the corresponding active attributes. ``` -------------------------------- ### init() Source: https://docs.craftcms.com/api/v5/craft-services-images.html Initializes the image driver, deciding which driver (GD or Imagick) will be used for image manipulations. ```APIDOC ## init() ### Description Initializes the image driver, deciding which driver (GD or Imagick) will be used for image manipulations. ``` -------------------------------- ### CSS Dependency Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-generalsettings-generalsettingsasset.html Example of how to define CSS file dependencies for an asset bundle. Use forward slashes for directory separators. ```php public $css = [ 'css/rebrand.css', ]; ``` -------------------------------- ### Search Syntax Example Source: https://docs.craftcms.com/api/v5/craft-base-element.html Demonstrates the search syntax for querying specific attributes that have been defined as searchable. ```text color:blue ``` -------------------------------- ### EditSectionAsset SourcePath Property Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-editsection-editsectionasset.html Example of setting the sourcePath for the EditSectionAsset bundle. This points to the directory containing the source asset files. ```php public $sourcePath = "__DIR__ . '/dist'"; ``` -------------------------------- ### init() Source: https://docs.craftcms.com/api/v5/craft-web-assetbundle.html Initializes the asset bundle. This method can be overridden to perform custom initialization logic, but the parent implementation should be called. ```APIDOC ## init() ### Description Initializes the bundle. If you override this method, make sure you call the parent implementation in the last. ### Method (Not specified, likely called internally during object instantiation or setup) ### Parameters (None explicitly documented) ### Request Example (Not applicable, this is an initialization method) ### Response (None explicitly documented) ``` -------------------------------- ### FindReplaceAsset `js` Property Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-findreplace-findreplaceasset.html Example of how to define the JavaScript files for the FindReplaceAsset bundle. This lists the local JavaScript files to be registered. ```php public $js = [ 'FindAndReplaceUtility.js', ]; ``` -------------------------------- ### Instance and Initialization Source: https://docs.craftcms.com/api/v5/craft-records-site.html Methods for creating and initializing object instances. ```APIDOC ## init() ### Description Initializes the object. ### Method POST ### Endpoint N/A (Method call) ## instance() ### Description Returns static class instance, which can be used to obtain meta information. ### Method GET ### Endpoint N/A (Method call) ## instantiate() ### Description Creates an active record instance. ### Method POST ### Endpoint N/A (Method call) ``` -------------------------------- ### `__construct()` Source: https://docs.craftcms.com/api/v5/craft-elements-asset.html Initializes a new instance of the class with the given configuration. ```APIDOC ## `__construct()` ### Description Initializes a new instance of the class with the given configuration. ### Arguments * `$config` (array) - The configuration options for the asset. ``` -------------------------------- ### Example Element Public Methods Source: https://docs.craftcms.com/api/v5/craft-test-mockclasses-elements-exampleelement.html This section lists and describes the public methods available for direct invocation on Example Element objects. ```APIDOC ## Public Methods setParent() Sets the element’s parent. setParentId() Sets the parent ID. setPrev() Sets the default previous element. setRevisionCreatorId() Sets the revision creator ID to be saved. setRevisionNotes() Sets the revision notes to be saved. setScenario() Sets the scenario for the model. setUiLabel() Defines what the element should be called within the control panel. setUiLabelPath() Defines any path segment labels that should be prepended to the element’s UI label. showStatusIndicator() Returns whether chips and cards for this element should include a status indicator. sortOptions() Returns the sort options for the element type. sourcePath() Returns the source path for a given source key, step key, and context. sources() Returns the source definitions that elements of this type may belong to. statuses() tableAttributes() Defines all of the available columns that can be shown in table views. toSarray() Converts the model into an array. trackChanges() Returns whether Craft should keep track of attribute and custom field changes made to this element type, including when the last time they were changed, and who was logged-in at the time. trigger() Triggers an event. validate() Performs the data validation. validateCustomFieldAttribute() Calls a custom validation function on a custom field. validateMultiple() Validates multiple models. ``` -------------------------------- ### AssetIndexesAsset SourcePath Property Example Source: https://docs.craftcms.com/api/v5/craft-web-assets-assetindexes-assetindexesasset.html Example of setting the sourcePath for the AssetIndexesAsset bundle. This is used when source asset files are not in a Web-accessible directory. ```php public $sourcePath = '__DIR__ . "/dist"'; ``` -------------------------------- ### init() Source: https://docs.craftcms.com/api/v5/craft-console-controller.html Initializes the object after it has been created and populated with the given configuration. ```APIDOC ## `init()` ### Description Initializes the object. This method is invoked at the end of the constructor. ### Throws * `yii\base\InvalidConfigException` - If the configuration is invalid. ``` -------------------------------- ### installPlugin() Source: https://docs.craftcms.com/api/v5/craft-controllers-baseupdatercontroller.html Attempts to install a plugin by its handle. This method allows for specifying the plugin edition. ```APIDOC ## installPlugin() ### Description Attempts to install a plugin by its handle. ### Arguments * `$handle` (string) - The handle of the plugin to install. * `$edition` (string, null) - The edition of the plugin to install. Can be null. ### Returns array – Array with installation results. ``` -------------------------------- ### init() Source: https://docs.craftcms.com/api/v5/craft-records-entry.html Initializes the entry record object. ```APIDOC ## init() ### Description Initializes the object. ### Method POST (implied) ### Endpoint N/A (Method call) ### Parameters None ### Response None ``` -------------------------------- ### getQueryParam() Source: https://docs.craftcms.com/api/v5/craft-web-request.html Returns the named GET parameter value. If the GET parameter does not exist, the second argument passed to this method will be returned as the default value. ```APIDOC ## getQueryParam() ### Description Returns the named GET parameter value. ### Arguments * `$name` (string) – The GET parameter name. * `$defaultValue` (`mixed`) – The default parameter value if the GET parameter does not exist. ### Returns `mixed` – The GET parameter value. ### Example ```php // get $_GET['foo'], if it exists $foo = Craft::$app->request->getQueryParam('foo'); // get $_GET['foo']['bar'], if it exists $bar = Craft::$app->request->getQueryParam('foo.bar'); ``` ```twig {# get $_GET['foo'], if it exists #} {% set foo = craft.app.request.getQueryParam('foo') %} {# get $_GET['foo']['bar'], if it exists #} {% set bar = craft.app.request.getQueryParam('foo.bar') %} ``` ```