diff --git a/framework/BaseYii.php b/framework/BaseYii.php index df0c809d1a..d23c611402 100644 --- a/framework/BaseYii.php +++ b/framework/BaseYii.php @@ -62,7 +62,7 @@ class BaseYii /** * @var array 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 + * are the corresponding class file paths (or [path aliases](guide:concept-aliases)). This property mainly affects * how [[autoload()]] works. * @see autoload() */ @@ -119,6 +119,8 @@ class BaseYii * * Note, this method does not check if the returned path exists or not. * + * See the [guide article on aliases](guide:concept-aliases) for more information. + * * @param string $alias the alias to be translated. * @param bool $throwException 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. @@ -196,6 +198,8 @@ class BaseYii * * Any trailing '/' and '\' characters in the given path will be trimmed. * + * See the [guide article on aliases](guide:concept-aliases) for more information. + * * @param string $alias 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()]]. diff --git a/framework/base/Controller.php b/framework/base/Controller.php index 84b51419f6..d9c52e19f5 100644 --- a/framework/base/Controller.php +++ b/framework/base/Controller.php @@ -342,7 +342,7 @@ class Controller extends Component implements ViewContextInterface * * The view to be rendered can be specified in one of the following formats: * - * - path alias (e.g. "@app/views/site/index"); + * - [path alias](guide:concept-aliases) (e.g. "@app/views/site/index"); * - absolute path within application (e.g. "//site/index"): the view name starts with double slashes. * The actual view file will be looked for under the [[Application::viewPath|view path]] of the application. * - absolute path within module (e.g. "/site/index"): the view name starts with a single slash. @@ -362,7 +362,7 @@ class Controller extends Component implements ViewContextInterface * 2. In the second step, it determines the actual layout file according to the previously found layout name * and context module. The layout name can be: * - * - a path alias (e.g. "@app/views/layouts/main"); + * - a [path alias](guide:concept-aliases) (e.g. "@app/views/layouts/main"); * - an absolute path (e.g. "/main"): the layout name starts with a slash. The actual layout file will be * looked for under the [[Application::layoutPath|layout path]] of the application; * - a relative path (e.g. "main"): the actual layout file will be looked for under the @@ -413,7 +413,7 @@ class Controller extends Component implements ViewContextInterface /** * Renders a view file. - * @param string $file the view file to be rendered. This can be either a file path or a path alias. + * @param string $file the view file to be rendered. This can be either a file path or a [path alias](guide:concept-aliases). * @param array $params the parameters (name-value pairs) that should be made available in the view. * @return string the rendering result. * @throws InvalidParamException if the view file does not exist. diff --git a/framework/base/Module.php b/framework/base/Module.php index e631d87498..9820202d70 100644 --- a/framework/base/Module.php +++ b/framework/base/Module.php @@ -231,7 +231,7 @@ class Module extends ServiceLocator /** * Sets the root directory of the module. * This method can only be invoked at the beginning of the constructor. - * @param string $path the root directory of the module. This can be either a directory name or a path alias. + * @param string $path the root directory of the module. This can be either a directory name or a [path alias](guide:concept-aliases). * @throws InvalidParamException if the directory does not exist. */ public function setBasePath($path) @@ -294,7 +294,7 @@ class Module extends ServiceLocator /** * Sets the directory that contains the layout files. - * @param string $path the root directory or path alias of layout files. + * @param string $path the root directory or [path alias](guide:concept-aliases) of layout files. * @throws InvalidParamException if the directory is invalid */ public function setLayoutPath($path) diff --git a/framework/base/Request.php b/framework/base/Request.php index eaae73b6b2..53af930f79 100644 --- a/framework/base/Request.php +++ b/framework/base/Request.php @@ -73,7 +73,7 @@ abstract class Request extends Component * The entry script file path can normally be determined based on the `SCRIPT_FILENAME` SERVER variable. * However, for some server configurations, this may not be correct or feasible. * This setter is provided so that the entry script file path can be manually specified. - * @param string $value the entry script file path. This can be either a file path or a path alias. + * @param string $value the entry script file path. This can be either a file path or a [path alias](guide:concept-aliases). * @throws InvalidConfigException if the provided entry script file path is invalid. */ public function setScriptFile($value) diff --git a/framework/base/Theme.php b/framework/base/Theme.php index aa60581c29..7ea7f247ba 100644 --- a/framework/base/Theme.php +++ b/framework/base/Theme.php @@ -76,7 +76,7 @@ class Theme extends Component /** * @var array the mapping between view directories and their corresponding themed versions. * This property is used by [[applyTo()]] when a view is trying to apply the theme. - * Path aliases can be used when specifying directories. + * [Path aliases](guide:concept-aliases) can be used when specifying directories. * If this property is empty or not set, a mapping [[Application::basePath]] to [[basePath]] will be used. */ public $pathMap; @@ -94,7 +94,7 @@ class Theme extends Component } /** - * @param string $url the base URL or path alias for this theme. All resources of this theme are considered + * @param string $url the base URL or [path alias](guide:concept-aliases) for this theme. All resources of this theme are considered * to be under this base URL. */ public function setBaseUrl($url) @@ -114,7 +114,7 @@ class Theme extends Component } /** - * @param string $path the root path or path alias of this theme. All resources of this theme are located + * @param string $path the root path or [path alias](guide:concept-aliases) of this theme. All resources of this theme are located * under this directory. * @see pathMap */ diff --git a/framework/base/View.php b/framework/base/View.php index 85ad7f0957..ecfa616d21 100644 --- a/framework/base/View.php +++ b/framework/base/View.php @@ -126,7 +126,7 @@ class View extends Component * * The view to be rendered can be specified in one of the following formats: * - * - path alias (e.g. "@app/views/site/index"); + * - [path alias](guide:concept-aliases) (e.g. "@app/views/site/index"); * - absolute path within application (e.g. "//site/index"): the view name starts with double slashes. * The actual view file will be looked for under the [[Application::viewPath|view path]] of the application. * - absolute path within current module (e.g. "/site/index"): the view name starts with a single slash. @@ -154,7 +154,7 @@ class View extends Component /** * Finds the view file based on the given view name. - * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] + * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. Please refer to [[render()]] * on how to specify this parameter. * @param object $context the context to be assigned to the view and can later be accessed via [[context]] * in the view. If the context implements [[ViewContextInterface]], it may also be used to locate @@ -429,7 +429,7 @@ class View extends Component * ``` * * @param string $viewFile the view file that will be used to decorate the content enclosed by this widget. - * This can be specified as either the view file path or path alias. + * This can be specified as either the view file path or [path alias](guide:concept-aliases). * @param array $params the variables (name => value) to be extracted and made available in the decorative view. * @return ContentDecorator the ContentDecorator widget instance * @see ContentDecorator diff --git a/framework/base/Widget.php b/framework/base/Widget.php index 80af12fa6e..b791391a11 100644 --- a/framework/base/Widget.php +++ b/framework/base/Widget.php @@ -214,7 +214,7 @@ class Widget extends Component implements ViewContextInterface * Renders a view. * The view to be rendered can be specified in one of the following formats: * - * - path alias (e.g. "@app/views/site/index"); + * - [path alias](guide:concept-aliases) (e.g. "@app/views/site/index"); * - absolute path within application (e.g. "//site/index"): the view name starts with double slashes. * The actual view file will be looked for under the [[Application::viewPath|view path]] of the application. * - absolute path within module (e.g. "/site/index"): the view name starts with a single slash. @@ -236,7 +236,7 @@ class Widget extends Component implements ViewContextInterface /** * Renders a view file. - * @param string $file the view file to be rendered. This can be either a file path or a path alias. + * @param string $file the view file to be rendered. This can be either a file path or a [path alias](guide:concept-aliases). * @param array $params the parameters (name-value pairs) that should be made available in the view. * @return string the rendering result. * @throws InvalidParamException if the view file does not exist. diff --git a/framework/caching/FileCache.php b/framework/caching/FileCache.php index 7069fe4020..31939b0740 100644 --- a/framework/caching/FileCache.php +++ b/framework/caching/FileCache.php @@ -35,7 +35,7 @@ class FileCache extends Cache */ public $keyPrefix = ''; /** - * @var string the directory to store cache files. You may use path alias here. + * @var string the directory to store cache files. You may use [path alias](guide:concept-aliases) here. * If not set, it will use the "cache" subdirectory under the application runtime path. */ public $cachePath = '@runtime/cache'; diff --git a/framework/caching/FileDependency.php b/framework/caching/FileDependency.php index 49c4e1e4c4..4ab98588b8 100644 --- a/framework/caching/FileDependency.php +++ b/framework/caching/FileDependency.php @@ -24,7 +24,7 @@ use yii\base\InvalidConfigException; class FileDependency extends Dependency { /** - * @var string the file path or path alias whose last modification time is used to + * @var string the file path or [path alias](guide:concept-aliases) whose last modification time is used to * check if the dependency has been changed. */ public $fileName; diff --git a/framework/captcha/CaptchaAction.php b/framework/captcha/CaptchaAction.php index 679fc254dd..81f3b3dfeb 100644 --- a/framework/captcha/CaptchaAction.php +++ b/framework/captcha/CaptchaAction.php @@ -87,7 +87,7 @@ class CaptchaAction extends Action */ public $offset = -2; /** - * @var string the TrueType font file. This can be either a file path or path alias. + * @var string the TrueType font file. This can be either a file path or [path alias](guide:concept-aliases). */ public $fontFile = '@yii/captcha/SpicyRice.ttf'; /** diff --git a/framework/console/controllers/AssetController.php b/framework/console/controllers/AssetController.php index 5ed5bb0ccb..d16220ad2a 100644 --- a/framework/console/controllers/AssetController.php +++ b/framework/console/controllers/AssetController.php @@ -31,7 +31,7 @@ use yii\web\AssetBundle; * * 4. Adjust your web application config to use compressed assets. * - * Note: in the console environment some path aliases like `@webroot` and `@web` may not exist, + * Note: in the console environment some [path aliases](guide:concept-aliases) like `@webroot` and `@web` may not exist, * so corresponding paths inside the configuration should be specified directly. * * Note: by default this command relies on an external tools to perform actual files compression, diff --git a/framework/console/controllers/BaseMigrateController.php b/framework/console/controllers/BaseMigrateController.php index 1da144c3da..6675a49a1b 100644 --- a/framework/console/controllers/BaseMigrateController.php +++ b/framework/console/controllers/BaseMigrateController.php @@ -33,7 +33,7 @@ abstract class BaseMigrateController extends Controller public $defaultAction = 'up'; /** * @var string the directory containing the migration classes. This can be either - * a path alias or a directory path. + * a [path alias](guide:concept-aliases) or a directory path. * * Migration classes located at this path should be declared without a namespace. * Use [[migrationNamespaces]] property in case you are using namespaced migrations. @@ -45,7 +45,7 @@ abstract class BaseMigrateController extends Controller /** * @var array list of namespaces containing the migration classes. * - * Migration namespaces should be resolvable as a path alias if prefixed with `@`, e.g. if you specify + * Migration namespaces should be resolvable as a [path alias](guide:concept-aliases) if prefixed with `@`, e.g. if you specify * the namespace `app\migrations`, the code `Yii::getAlias('@app/migrations')` should be able to return * the file path to the directory this namespace refers to. * diff --git a/framework/console/controllers/ServeController.php b/framework/console/controllers/ServeController.php index db8523c71e..65f15133fd 100644 --- a/framework/console/controllers/ServeController.php +++ b/framework/console/controllers/ServeController.php @@ -32,7 +32,7 @@ class ServeController extends Controller */ public $port = 8080; /** - * @var string path or path alias to directory to serve + * @var string path or [path alias](guide:concept-aliases) to directory to serve */ public $docroot = '@app/web'; /** diff --git a/framework/db/Connection.php b/framework/db/Connection.php index a75c80a8fa..d666bc526f 100644 --- a/framework/db/Connection.php +++ b/framework/db/Connection.php @@ -156,7 +156,7 @@ class Connection extends Component * Please refer to the [PHP manual](http://php.net/manual/en/pdo.construct.php) on * the format of the DSN string. * - * For [SQLite](http://php.net/manual/en/ref.pdo-sqlite.connection.php) you may use a path alias + * For [SQLite](http://php.net/manual/en/ref.pdo-sqlite.connection.php) you may use a [path alias](guide:concept-aliases) * for specifying the database path, e.g. `sqlite:@app/data/db.sql`. * * @see charset diff --git a/framework/log/FileTarget.php b/framework/log/FileTarget.php index e4c895c0e3..fabf50e599 100644 --- a/framework/log/FileTarget.php +++ b/framework/log/FileTarget.php @@ -26,7 +26,7 @@ use yii\helpers\FileHelper; class FileTarget extends Target { /** - * @var string log file path or path alias. If not set, it will use the "@runtime/logs/app.log" file. + * @var string log file path or [path alias](guide:concept-aliases). If not set, it will use the "@runtime/logs/app.log" file. * The directory containing the log files will be automatically created if not existing. */ public $logFile; diff --git a/framework/mail/BaseMailer.php b/framework/mail/BaseMailer.php index 07ab9c1768..98ede5d0d5 100644 --- a/framework/mail/BaseMailer.php +++ b/framework/mail/BaseMailer.php @@ -47,7 +47,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont * The property can take the following values: * * - a relative view name: a view file relative to [[viewPath]], e.g., 'layouts/html'. - * - a path alias: an absolute view file path specified as a path alias, e.g., '@app/mail/html'. + * - a [path alias](guide:concept-aliases): an absolute view file path specified as a path alias, e.g., '@app/mail/html'. * - a boolean false: the layout is disabled. */ public $htmlLayout = 'layouts/html'; @@ -155,7 +155,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont * * @param string|array|null $view the view to be used for rendering the message body. This can be: * - * - a string, which represents the view name or path alias for rendering the HTML body of the email. + * - a string, which represents the view name or [path alias](guide:concept-aliases) for rendering the HTML body of the email. * In this case, the text body will be generated by applying `strip_tags()` to the HTML body. * - an array with 'html' and/or 'text' elements. The 'html' element refers to the view name or path alias * for rendering the HTML body, while 'text' element is for rendering the text body. For example, @@ -291,9 +291,9 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont /** * Renders the specified view with optional parameters and layout. * The view will be rendered using the [[view]] component. - * @param string $view the view name or the path alias of the view file. + * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. * @param array $params the parameters (name-value pairs) that will be extracted and made available in the view file. - * @param string|bool $layout layout view name or path alias. If false, no layout will be applied. + * @param string|bool $layout layout view name or [path alias](guide:concept-aliases). If false, no layout will be applied. * @return string the rendering result. */ public function render($view, $params = [], $layout = false) @@ -359,7 +359,7 @@ abstract class BaseMailer extends Component implements MailerInterface, ViewCont /** * @param string $path the directory that contains the view files for composing mail messages - * This can be specified as an absolute path or a path alias. + * This can be specified as an absolute path or a [path alias](guide:concept-aliases). */ public function setViewPath($path) { diff --git a/framework/mail/MailerInterface.php b/framework/mail/MailerInterface.php index 12542de0e1..d6c2cd71e6 100644 --- a/framework/mail/MailerInterface.php +++ b/framework/mail/MailerInterface.php @@ -33,7 +33,7 @@ interface MailerInterface * * @param string|array|null $view the view to be used for rendering the message body. This can be: * - * - a string, which represents the view name or path alias for rendering the HTML body of the email. + * - a string, which represents the view name or [path alias](guide:concept-aliases) for rendering the HTML body of the email. * In this case, the text body will be generated by applying `strip_tags()` to the HTML body. * - an array with 'html' and/or 'text' elements. The 'html' element refers to the view name or path alias * for rendering the HTML body, while 'text' element is for rendering the text body. For example, diff --git a/framework/mutex/FileMutex.php b/framework/mutex/FileMutex.php index d673785e1f..973c633c60 100644 --- a/framework/mutex/FileMutex.php +++ b/framework/mutex/FileMutex.php @@ -41,7 +41,7 @@ use yii\helpers\FileHelper; class FileMutex extends Mutex { /** - * @var string the directory to store mutex files. You may use path alias here. + * @var string the directory to store mutex files. You may use [path alias](guide:concept-aliases) here. * Defaults to the "mutex" subdirectory under the application runtime path. */ public $mutexPath = '@runtime/mutex'; diff --git a/framework/rbac/PhpManager.php b/framework/rbac/PhpManager.php index 26eccaa677..6b6b5aed89 100644 --- a/framework/rbac/PhpManager.php +++ b/framework/rbac/PhpManager.php @@ -38,7 +38,7 @@ class PhpManager extends BaseManager { /** * @var string the path of the PHP script that contains the authorization items. - * This can be either a file path or a path alias to the file. + * This can be either a file path or a [path alias](guide:concept-aliases) to the file. * Make sure this file is writable by the Web server process if the authorization needs to be changed online. * @see loadFromFile() * @see saveToFile() @@ -46,7 +46,7 @@ class PhpManager extends BaseManager public $itemFile = '@app/rbac/items.php'; /** * @var string the path of the PHP script that contains the authorization assignments. - * This can be either a file path or a path alias to the file. + * This can be either a file path or a [path alias](guide:concept-aliases) to the file. * Make sure this file is writable by the Web server process if the authorization needs to be changed online. * @see loadFromFile() * @see saveToFile() @@ -54,7 +54,7 @@ class PhpManager extends BaseManager public $assignmentFile = '@app/rbac/assignments.php'; /** * @var string the path of the PHP script that contains the authorization rules. - * This can be either a file path or a path alias to the file. + * This can be either a file path or a [path alias](guide:concept-aliases) to the file. * Make sure this file is writable by the Web server process if the authorization needs to be changed online. * @see loadFromFile() * @see saveToFile() diff --git a/framework/test/ActiveFixture.php b/framework/test/ActiveFixture.php index eed2c97ed1..bdac34a99e 100644 --- a/framework/test/ActiveFixture.php +++ b/framework/test/ActiveFixture.php @@ -40,7 +40,7 @@ class ActiveFixture extends BaseActiveFixture */ public $tableName; /** - * @var string|bool the file path or path alias of the data file that contains the fixture data + * @var string|bool the file path or [path alias](guide:concept-aliases) of the data file that contains the fixture data * to be returned by [[getData()]]. If this is not set, it will default to `FixturePath/data/TableName.php`, * where `FixturePath` stands for the directory containing this fixture class, and `TableName` stands for the * name of the table associated with this fixture. You can set this property to be false to prevent loading any data. diff --git a/framework/test/ArrayFixture.php b/framework/test/ArrayFixture.php index 7262e16e44..f96d72162d 100644 --- a/framework/test/ArrayFixture.php +++ b/framework/test/ArrayFixture.php @@ -28,7 +28,7 @@ class ArrayFixture extends Fixture implements \IteratorAggregate, \ArrayAccess, */ public $data = []; /** - * @var string|bool the file path or path alias of the data file that contains the fixture data + * @var string|bool the file path or [path alias](guide:concept-aliases) of the data file that contains the fixture data * to be returned by [[getData()]]. You can set this property to be false to prevent loading any data. */ public $dataFile; diff --git a/framework/test/BaseActiveFixture.php b/framework/test/BaseActiveFixture.php index e3b60920ee..fd86f1ff12 100644 --- a/framework/test/BaseActiveFixture.php +++ b/framework/test/BaseActiveFixture.php @@ -32,7 +32,7 @@ abstract class BaseActiveFixture extends DbFixture implements \IteratorAggregate */ public $data = []; /** - * @var string|bool the file path or path alias of the data file that contains the fixture data + * @var string|bool the file path or [path alias](guide:concept-aliases) of the data file that contains the fixture data * to be returned by [[getData()]]. You can set this property to be false to prevent loading any data. */ public $dataFile; diff --git a/framework/test/InitDbFixture.php b/framework/test/InitDbFixture.php index 285269edf3..4212f4b87f 100644 --- a/framework/test/InitDbFixture.php +++ b/framework/test/InitDbFixture.php @@ -30,7 +30,7 @@ class InitDbFixture extends DbFixture { /** * @var string the init script file that should be executed when loading this fixture. - * This should be either a file path or path alias. Note that if the file does not exist, + * This should be either a file path or [path alias](guide:concept-aliases). Note that if the file does not exist, * no error will be raised. */ public $initScript = '@app/tests/fixtures/initdb.php'; diff --git a/framework/web/AssetConverter.php b/framework/web/AssetConverter.php index a311a9fcbd..55e67d1276 100644 --- a/framework/web/AssetConverter.php +++ b/framework/web/AssetConverter.php @@ -26,7 +26,7 @@ class AssetConverter extends Component implements AssetConverterInterface * The keys are the asset file extension names, and the values are the corresponding * target script types (either "css" or "js") and the commands used for the conversion. * - * You may also use a path alias to specify the location of the command: + * You may also use a [path alias](guide:concept-aliases) to specify the location of the command: * * ```php * [ @@ -78,7 +78,7 @@ class AssetConverter extends Component implements AssetConverterInterface /** * Runs a command to convert asset files. - * @param string $command the command to run. If prefixed with an `@` it will be treated as a path alias. + * @param string $command the command to run. If prefixed with an `@` it will be treated as a [path alias](guide:concept-aliases). * @param string $basePath asset base path and command working directory * @param string $asset the name of the asset file * @param string $result the name of the file to be generated by the converter command diff --git a/framework/web/Session.php b/framework/web/Session.php index 588c29f9fb..99c7fb3ee6 100644 --- a/framework/web/Session.php +++ b/framework/web/Session.php @@ -333,7 +333,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co /** * Sets the current session save path. * This is a wrapper for [PHP session_save_path()](http://php.net/manual/en/function.session-save-path.php). - * @param string $value the current session save path. This can be either a directory name or a path alias. + * @param string $value the current session save path. This can be either a directory name or a [path alias](guide:concept-aliases). * @throws InvalidParamException if the path is not a valid directory */ public function setSavePath($value) diff --git a/framework/widgets/ContentDecorator.php b/framework/widgets/ContentDecorator.php index 26dee57c41..862960a9ad 100644 --- a/framework/widgets/ContentDecorator.php +++ b/framework/widgets/ContentDecorator.php @@ -44,7 +44,7 @@ class ContentDecorator extends Widget { /** * @var string the view file that will be used to decorate the content enclosed by this widget. - * This can be specified as either the view file path or path alias. + * This can be specified as either the view file path or [path alias](guide:concept-aliases). */ public $viewFile; /**