Class Yii
Yii is a helper class serving common framework functionalities.
It encapsulates YiiBase
which provides the actual implementation. By
writing your own Yii class, you can customize some functionalities of
YiiBase.
-
YiiBase
-
Yii
Methods summary
public static
|
#
getRootPath( )
Precondition: Request component has already been created. If it hasn't,
infinite recursion will occur when Yii::app()->getRequest () is called
implicitly by self::app()->request.
Precondition: Request component has already been created. If it hasn't,
infinite recursion will occur when Yii::app()->getRequest () is called
implicitly by self::app()->request.
|
public static
X2WebApplication
|
|
public static
String
|
#
getCustomPath( String $path )
Checks if a custom version of a file exists
Checks if a custom version of a file exists
Parameters
- $path
String $path The file path
Returns
String $path The original file path, or the version in /custom if it exists
|
public static
String
|
#
resetCustomPath( String $customPath )
Checks if a custom version of a class file exists
Checks if a custom version of a class file exists
Parameters
- $customPath
String $path The path to something in /custom
Returns
String $path The path to the original file or folder
|
public static
string
|
#
import( string $alias, boolean $forceInclude = false )
Modified to check custom paths This method is Copyright (c) 2008-2014 by Yii
Software LLC http://www.yiiframework.com/license/
Parameters
- $alias
string $alias path alias to be imported
- $forceInclude
boolean $forceInclude whether to include the class file immediately. If false, the class
file will be included only when the class is being used. This parameter is used
only when the path alias refers to a class.
Returns
string the class name or the directory that this alias refers to
Throws
Overrides
|
public static
|
#
x2_autoload( mixed $className, mixed $classMapOnly = false )
|
public static
string
|
#
t( string $category, string $message, array $params = array(), string $source = null, string $language = null )
Translates a message to the specified language. This method supports choice
format (see CChoiceFormat ), i.e., the message returned will be chosen
from a few candidates according to the given number value. This feature is
mainly used to solve plural format issue in case a message has different plural
forms in some languages.
Translates a message to the specified language. This method supports choice
format (see CChoiceFormat ), i.e., the message returned will be chosen
from a few candidates according to the given number value. This feature is
mainly used to solve plural format issue in case a message has different plural
forms in some languages.
Parameters
- $category
string $category message category. Please use only word letters. Note, category 'yii'
is reserved for Yii framework core code use. See CPhpMessageSource for
more interpretation about message category.
- $message
string $message the original message
- $params
array $params parameters to be applied to the message using <span
class="php-keyword2">strtr</span> . The first parameter can be a
number without key. And in this case, the method will call CChoiceFormat::format() to choose an appropriate message translation. Starting
from version 1.1.6 you can pass parameter for CChoiceFormat::format() or
plural forms format without wrapping it with array. This parameter is then
available as {n} in the message translation string.
- $source
string $source which message source application component to use. Defaults to null,
meaning using 'coreMessages' for messages belonging to the 'yii' category and
using 'messages' for the rest messages.
- $language
string $language the target language. If null (default), the CApplication::getLanguage application language will be used.
Returns
string the translated message
See
Overrides
|
public static
|
|
Methods inherited from YiiBase
app(),
autoload(),
beginProfile(),
createApplication(),
createComponent(),
createConsoleApplication(),
endProfile(),
getFrameworkPath(),
getLogger(),
getPathOfAlias(),
getVersion(),
log(),
powered(),
registerAutoloader(),
setApplication(),
setLogger(),
setPathOfAlias(),
trace()
|