Documentation

Loader
in package

FinalYes

Various CI class loaders.

Table of Contents

Methods

config()  : mixed
Load config.
database()  : DB|null|false
Load databse.
library()  : void
Load library.
model()  : void
Load model.

Methods

config()

Load config.

public static config(string $configFile[, string|null $itemName = null ]) : mixed
Parameters
$configFile : string

Name of the config file.

$itemName : string|null = null

(optional) The name of the item in the config file to be retrieved. If omitted, an object with all items in the config file is obtained.

Return values
mixed

Config data.

database()

Load databse.

public static database([mixed $config = 'default' ][, bool $return = false ][, mixed $queryBuilder = null ][, bool $overwrite = false ]) : DB|null|false
Parameters
$config : mixed = 'default'

(optional) Connection group name or database configuration options. Default is "default".

$return : bool = false

(optional) Whether to return a DB instance. Default is false.

$queryBuilder : mixed = null

(optional) An instance that overrides the existing CI_DB_query_builder.

$overwrite : bool = false

(optional) Whether to overwrite the DB of the global CI_Controller instance with the DB instance generated this time. Default is false.

Return values
DB|null|false

Database object if return is set to true, false if return fails, null otherwise.

library()

Load library.

public static library(string|array<string|int, string> $libraries) : void
Parameters
$libraries : string|array<string|int, string>

Library Name.

model()

Load model.

public static model(string|array<string|int, string> $models) : void
Parameters
$models : string|array<string|int, string>

Model Name.


        
On this page

Search results