别名“”无效,请确定它指向一个已存在的目录或文件. [ 新手入门 ]
别名 "frontend.protected.models.LoginForm" 是无效的.请确定它指向一个已存在的目录或文件. 想知道是什么原因,求大神们解答一下
共 1 条回复
-
fantasy2012 回复于 2016-12-19 09:55 举报
getAlias() public method
Translates a path alias into an actual path.The translation is done according to the following procedure:
If the given alias does not start with '@', it is returned back without change;
Otherwise, look for the longest registered alias that matches the beginning part of the given alias. If it exists, replace the matching part of the given alias with the corresponding registered path.
Throw an exception or return false, depending on the $throwException parameter.
For example, by default '@yii' is registered as the alias to the Yii framework directory, say '/path/to/yii'. The alias '@yii/web' would then be translated into '/path/to/yii/web'.If you have registered two aliases '@foo' and '@foo/bar'. Then translating '@foo/bar/config' would replace the part '@foo/bar' (instead of '@foo') with the corresponding registered path. This is because the longest alias takes precedence.
However, if the alias to be translated is '@foo/barbar/config', then '@foo' will be replaced instead of '@foo/bar', because '/' serves as the boundary character.
Note, this method does not check if the returned path exists or not.
爱学习的我
最后登录:2016-12-15
在线时长:0小时10分
- 粉丝0
- 金钱20
- 威望0
- 积分20