Property | Type | Description | |
---|---|---|---|
$aliases | registered path aliases | ||
$app | the application instance | ||
$classMap | class map used by the Yii autoloading mechanism. The array keys are the class names (without leading backslashes), and the array values are the corresponding class file paths (or path aliases). This property mainly affects how BaseYii::autoload works. | ||
$container | the dependency injection (DI) container used by BaseYii::createObject. You may use [[Container::set()]] to set up the needed dependencies of classes and their initial property values. |
Method | Description | |
---|---|---|
autoload ( string $className ) | Class autoload loader. | |
beginProfile ( string $token, string $category = 'application' ) | Marks the beginning of a code block for profiling. | |
configure ( object $object, array $properties ) : object | Configures an object with the initial property values. | |
createObject ( string | array | callable $type, array $params = [] ) : object | Creates a new object using the given configuration. | |
endProfile ( string $token, string $category = 'application' ) | Marks the end of a code block for profiling. | |
error ( string $message, string $category = 'application' ) | Logs an error message. | |
getAlias ( string $alias, boolean $throwException = true ) : string | boolean | Translates a path alias into an actual path. | |
getLogger ( ) : |
||
getObjectVars ( object $object ) : array | Returns the public member variables of an object. | |
getRootAlias ( string $alias ) : string | boolean | Returns the root alias part of a given alias. | |
getVersion ( ) : string | Returns a string representing the current version of the Yii framework. | |
info ( string $message, string $category = 'application' ) | Logs an informative message. | |
powered ( ) : string | Returns an HTML hyperlink that can be displayed on your Web page showing "Powered by Yii Framework" information. | |
setAlias ( string $alias, string $path ) | Registers a path alias. | |
setLogger ( |
Sets the logger object. | |
t ( string $category, string $message, array $params = [], string $language = null ) : string | Translates a message to the specified language. | |
trace ( string $message, string $category = 'application' ) | Logs a trace message. | |
warning ( string $message, string $category = 'application' ) | Logs a warning message. |
public static beginProfile ( string $token, string $category = 'application' ) | ||
$token | string | token for the code block |
$category | string | the category of this log message |
public static createObject ( string | array | callable $type, array $params = [] ) : object | ||
$type | string | array | callable | the object type. This can be specified in one of the following forms: - a string: representing the class name of the object to be created - a configuration array: the array must contain a `class` element which is treated as the object class, and the rest of the name-value pairs will be used to initialize the corresponding object properties - a PHP callable: either an anonymous function or an array representing a class method (`[$class or $object, $method]`). The callable should return a new instance of the object being created. |
$params | array | the constructor parameters |
return | object | the created object |
public static endProfile ( string $token, string $category = 'application' ) | ||
$token | string | token for the code block |
$category | string | the category of this log message |
public static getAlias ( string $alias, boolean $throwException = true ) : string | boolean | ||
$alias | string | the alias to be translated. |
$throwException | boolean | whether to throw an exception if the given alias is invalid. If this is false and an invalid alias is given, false will be returned by this method. |
return | string | boolean | the path corresponding to the alias, false if the root alias is not previously registered. |
public static getLogger ( ) : |
||
return | message logger |
public static getObjectVars ( object $object ) : array | ||
$object | object | the object to be handled |
return | array | the public member variables of the object |
public static getVersion ( ) : string | ||
return | string | the version of Yii framework |
public static setAlias ( string $alias, string $path ) | ||
$alias | string | the alias name (e.g. "@yii"). It must start with a '@' character. It may contain the forward slash '/' which serves as boundary character when performing alias translation by [[getAlias()]]. |
$path | string | the path corresponding to the alias. If this is null, the alias will be removed. Trailing '/' and '\' characters will be trimmed. This can be - a directory or a file path (e.g. `/tmp`, `/tmp/main.txt`) - a URL (e.g. `http://www.yiiframework.com`) - a path alias (e.g. `@yii/base`). In this case, the path alias will be converted into the actual path first by calling [[getAlias()]]. |
public static setLogger ( |
||
$logger | the logger object. |
public static t ( string $category, string $message, array $params = [], string $language = null ) : string | ||
$category | string | the message category. |
$message | string | the message to be translated. |
$params | array | the parameters that will be used to replace the corresponding placeholders in the message. |
$language | string | the language code (e.g. `en-US`, `en`). If this is null, the current [[\yii\base\Application::language|application language]] will be used. |
return | string | the translated message. |
public static $classMap |
public static $container |