Class yii\validators\ValidationAsset
| 继承 | yii\validators\ValidationAsset » yii\web\AssetBundle » yii\base\BaseObject |
|---|---|
| 实现 | yii\base\Configurable |
| 可用版本自 | 2.0 |
| 源码 | https://github.com/yiichina/yii2/blob/api/framework/validators/ValidationAsset.php |
This asset bundle provides the javascript files for client validation.
公共属性
| 属性 | 类型 | 描述 | 被定义在 |
|---|---|---|---|
| $basePath | string | 此资源包里,包含着资源文件的可以 Web 访问的目录。 如果设置了 $sourcePath,这个属性会被 yii\web\AssetManager 覆盖 当它从 $sourcePath 发布资源文件时。 你可以使用目录或目录的别名。 | yii\web\AssetBundle |
| $baseUrl | string | 属性 $js、$css 里定义的相对路径的资源文件的基本 URL。 如果设置了 $sourcePath,这个属性会被 yii\web\AssetManager 覆盖 当它从 $sourcePath 发布资源文件时。 You can use either a URL or an alias of the URL. | yii\web\AssetBundle |
| $css | array | 此资源包包含的 CSS 文件列表。 Each CSS file can be specified 每个 CSS 文件都能像 $js 注释里的三种格式那样指定。 请注意,只能使用正斜杠“/”作为目录分隔符。 | yii\web\AssetBundle |
| $cssOptions | array | 将传递给 yii\web\View::registerCssFile() 方法的选项, 当此资源包注册 CSS 文件时。 | yii\web\AssetBundle |
| $depends | yii\validators\ValidationAsset | ||
| $js | yii\validators\ValidationAsset | ||
| $jsOptions | array | 将传递给 yii\web\View::registerJsFile() 方法的选项, 当此资源包注册 JS 文件时。 | yii\web\AssetBundle |
| $publishOptions | array | 将传递给 yii\web\AssetManager::publish() 方法的选项, 当此资源包正在发布时。仅在设置了 $sourcePath 时使用此属性。 | yii\web\AssetBundle |
| $sourcePath | yii\validators\ValidationAsset |
公共方法
| 方法 | 描述 | 被定义在 |
|---|---|---|
| __call() | Calls the named method which is not a class method. | yii\base\BaseObject |
| __construct() | Constructor. | yii\base\BaseObject |
| __get() | Returns the value of an object property. | yii\base\BaseObject |
| __isset() | Checks if a property is set, i.e. defined and not null. | yii\base\BaseObject |
| __set() | Sets value of an object property. | yii\base\BaseObject |
| __unset() | Sets an object property to null. | yii\base\BaseObject |
| canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\BaseObject |
| canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\BaseObject |
| className() | Returns the fully qualified name of this class. | yii\base\BaseObject |
| hasMethod() | Returns a value indicating whether a method is defined. | yii\base\BaseObject |
| hasProperty() | Returns a value indicating whether a property is defined. | yii\base\BaseObject |
| init() | Initializes the object. | yii\base\BaseObject |
| publish() | 当源码不在 Web 可访问的目录下面时,发布资源包。 它也会用 asset converter 去编译 非 CSS 或者 JS 的文件 (比如,LESS,Sass)成为 CSS 和 JS 文件。 | yii\web\AssetBundle |
| register() | 注册资源包到某视图。 | yii\web\AssetBundle |
| registerAssetFiles() | 注册 CSS 和 JS 文件到所给的视图。 | yii\web\AssetBundle |