Skip to content

Commit 2e7adee

Browse files
updated some issues related to snippets
1 parent 348cd90 commit 2e7adee

File tree

9 files changed

+56
-56
lines changed

9 files changed

+56
-56
lines changed

snippets/helpers/file-helper.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"FileHelper::createDirectory": {
88
"prefix": "FileHelper::createDirectory",
9-
"body": "FileHelper::createDirectory(\\$${path}, \\$${mode = 509}, \\$${recursive = true})$3",
9+
"body": "FileHelper::createDirectory(\\$${path}, \\$${mode = 509}, \\$${recursive = ${5|true, false|}})$3",
1010
"description": "Creates a new directory."
1111
},
1212
"FileHelper::filterPath": {
@@ -26,7 +26,7 @@
2626
},
2727
"FileHelper::getMimeType": {
2828
"prefix": "FileHelper::getMimeType",
29-
"body": "FileHelper::getMimeType(\\$${file}, \\$${magicFile = null}, \\$${checkedExtension = true})$3",
29+
"body": "FileHelper::getMimeType(\\$${file}, \\$${magicFile = null}, \\$${checkedExtension = ${5|true, false|}})$3",
3030
"description": "Determines the MIME type of the specified file."
3131
},
3232
"FileHelper::getMimeTypeByExtension": {
@@ -36,12 +36,12 @@
3636
},
3737
"FileHelper::loadMimeTypes": {
3838
"prefix": "FileHelper::loadMimeTypes",
39-
"body": "FileHelper::loadMimeTypes(\\$${magicFile})$3",
39+
"body": "FileHelper::loadMimeTypes(\\$${1:magicFile})$2",
4040
"description": "Loads MIME types from the specified file."
4141
},
4242
"FileHelper::localize": {
4343
"prefix": "FileHelper::localize",
44-
"body": "FileHelper::localize(\\$${file}, \\$${language = null}, \\$${sourceLanguage = null})$3",
44+
"body": "FileHelper::localize(\\$${1:file}, \\$${2:language = null}, \\$${3:sourceLanguage = null})$4",
4545
"description": "Returns the localized version of a specified file."
4646
},
4747
"FileHelper::normalizePath": {

snippets/helpers/html.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
{
22
"Html::a": {
33
"prefix": "Html::a",
4-
"body": "Html::a(\\$${text}, \\$${url}, \\$${options = []})$3",
4+
"body": "Html::a(\\$${1:text}, \\$${2:url}, \\$${3:options = []})$4",
55
"description": "Generates a hyperlink tag."
66
},
77
"Html::activeBooleanInput": {
88
"prefix": "Html::activeBooleanInput",
9-
"body": "Html::activeBooleanInput(\\$${type}, \\$${model}, \\$${attribute}, \\$${options = []})$3",
9+
"body": "Html::activeBooleanInput(\\$${1:type}, \\$${2:model}, \\$${3:attribute}, \\$${4:options = []})$5",
1010
"description": "Generates a boolean input This method is mainly called by activeCheckbox() and activeRadio()."
1111
},
1212
"Html::activeCheckbox": {
1313
"prefix": "Html::activeCheckbox",
14-
"body": "Html::activeCheckbox(\\$${model}, \\$${attribute}, \\$${options = []})$3",
14+
"body": "Html::activeCheckbox(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
1515
"description": "Generates a checkbox tag together with a label for the given model attribute."
1616
},
1717
"Html::activeCheckboxList": {
1818
"prefix": "Html::activeCheckboxList",
19-
"body": "Html::activeCheckboxList(\\$${model}, \\$${attribute}, \\$${items}, \\$${options = []})$3",
19+
"body": "Html::activeCheckboxList(\\$${1:model}, \\$${2:attribute}, \\$${3:items}, \\$${4:options = []})$5",
2020
"description": "Generates a list of checkboxes."
2121
},
2222
"Html::activeDropDownList": {
2323
"prefix": "Html::activeDropDownList",
24-
"body": "Html::activeDropDownList(\\$${model}, \\$${attribute}, \\$${items}, \\$${options = []})$3",
24+
"body": "Html::activeDropDownList(\\$${1:model}, \\$${2:attribute}, \\$${3:items}, \\$${4:options = []})$5",
2525
"description": "Generates a drop-down list for the given model attribute."
2626
},
2727
"Html::activeFileInput": {
2828
"prefix": "Html::activeFileInput",
29-
"body": "Html::activeFileInput(\\$${model}, \\$${attribute}, \\$${options = []})$3",
29+
"body": "Html::activeFileInput(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
3030
"description": "Generates a file input tag for the given model attribute."
3131
},
3232
"Html::activeHiddenInput": {
3333
"prefix": "Html::activeHiddenInput",
34-
"body": "Html::activeHiddenInput(\\$${model}, \\$${attribute}, \\$${options = []})$3",
34+
"body": "Html::activeHiddenInput(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
3535
"description": "Generates a hidden input tag for the given model attribute."
3636
},
3737
"Html::activeHint": {
3838
"prefix": "Html::activeHint",
39-
"body": "Html::activeHint(\\$${model}, \\$${attribute}, \\$${options = []})$3",
39+
"body": "Html::activeHint(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
4040
"description": "Generates a hint tag for the given model attribute."
4141
},
4242
"Html::activeInput": {
@@ -131,7 +131,7 @@
131131
},
132132
"Html::cssFile": {
133133
"prefix": "Html::cssFile",
134-
"body": "Html::cssFile(\\$${url}, \\$${options = []})$3",
134+
"body": "Html::cssFile(\\$${1:url}, \\$${1:options = []})$3",
135135
"description": "Generates a link tag that refers to an external CSS file."
136136
},
137137
"Html::cssStyleFromArray": {
@@ -146,17 +146,17 @@
146146
},
147147
"Html::decode": {
148148
"prefix": "Html::decode",
149-
"body": "Html::decode($content})$3",
149+
"body": "Html::decode(\\$${1:content})$2",
150150
"description": "Decodes special HTML entities back to the corresponding characters."
151151
},
152152
"Html::dropDownList": {
153153
"prefix": "Html::dropDownList",
154-
"body": "Html::dropDownList($name}, \\$${selection = null}, \\$${items = []}, \\$${options = []})$3",
154+
"body": "Html::dropDownList(\\$${1:name}, \\$${2:selection = null}, \\$${3:items = []}, \\$${4:options = []})$5",
155155
"description": "Generates a drop-down list."
156156
},
157157
"Html::encode": {
158158
"prefix": "Html::encode",
159-
"body": "Html::encode($content}, \\$${doubleEncode = true})$3",
159+
"body": "Html::encode(\\$${1:content}, \\$${2:doubleEncode = true})$3",
160160
"description": "Encodes special characters into HTML entities."
161161
},
162162
"Html::endForm": {
@@ -166,12 +166,12 @@
166166
},
167167
"Html::endTag": {
168168
"prefix": "Html::endTag",
169-
"body": "Html::endTag($name})$3",
169+
"body": "Html::endTag(\\$${1:name})$2",
170170
"description": "Generates an end tag."
171171
},
172172
"Html::error": {
173173
"prefix": "Html::error",
174-
"body": "Html::error($model, \\$${attribute}, \\$${options = []})$3",
174+
"body": "Html::error(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
175175
"description": "Generates a tag that contains the first validation error of the specified model attribute."
176176
}
177177
}

snippets/helpers/inflector.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"Inflector::ordinalize": {
3333
"prefix": "Inflector::ordinalize",
34-
"body": "Inflector::ordinalize(\\$${number})$3",
34+
"body": "Inflector::ordinalize(\\$${1:number})$2",
3535
"description": "Ordinalize number."
3636
},
3737
"Inflector::pluralize": {
@@ -46,7 +46,7 @@
4646
},
4747
"Inflector::singularize": {
4848
"prefix": "Inflector::singularize",
49-
"body": "Inflector::singularize(\\$${word})$3",
49+
"body": "Inflector::singularize(\\$${1:word})$2",
5050
"description": "Singularize word."
5151
},
5252
"Inflector::slug": {
@@ -56,7 +56,7 @@
5656
},
5757
"Inflector::tableize": {
5858
"prefix": "Inflector::tableize",
59-
"body": "Inflector::tableize(\\$${className})$3",
59+
"body": "Inflector::tableize(\\$${1:className})$2",
6060
"description": "Creats a tableize string."
6161
},
6262
"Inflector::titleize": {
@@ -66,17 +66,17 @@
6666
},
6767
"Inflector::transliterate": {
6868
"prefix": "Inflector::transliterate",
69-
"body": "Inflector::transliterate(\\$${1:string}, \\$${2:transliterator ${5|true, false|}})$3",
69+
"body": "Inflector::transliterate(\\$${1:string}, \\$${2:transliterator ${3|true, false|}})$4",
7070
"description": "Creats a transliterate string."
7171
},
7272
"Inflector::underscore": {
7373
"prefix": "Inflector::underscore",
74-
"body": "Inflector::underscore(\\$${words})$3",
74+
"body": "Inflector::underscore(\\$${1:words})$2",
7575
"description": "Creats a underscore string."
7676
},
7777
"Inflector::variablize": {
7878
"prefix": "Inflector::variablize",
79-
"body": "Inflector::variablize(\\$${word})$3",
79+
"body": "Inflector::variablize(\\$${1:word})$2",
8080
"description": "Creats a variablize string."
8181
}
8282
}

snippets/helpers/json.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"Json::decode": {
33
"prefix": "Json::decode",
4-
"body": "Json::decode(\\$${json}, \\$${asArray = true})$3",
4+
"body": "Json::decode(\\$${1:json}, \\$${2:asArray = ${3|true, false|}})$4",
55
"description": "Decodes the given JSON string into a PHP data structure."
66
},
77
"Json::encode": {
88
"prefix": "Json::encode",
9-
"body": "Json::encode(\\$${json}, \\$${asArray = true})$3",
9+
"body": "Json::encode(\\$${1:json}, \\$${2:asArray = ${3|true, false|}})$4",
1010
"description": "Encodes the given value into a JSON string."
1111
},
1212
"Json::htmlEncode": {
1313
"prefix": "Json::htmlEncode",
14-
"body": "Json::htmlEncode(\\$${value})$3",
14+
"body": "Json::htmlEncode(\\$${1:value})$2",
1515
"description": "Encodes the given value into a JSON string HTML-escaping entities so it is safe to be embedded in HTML code."
1616
}
1717
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
{
22
"StringHelper::basename": {
33
"prefix": "StringHelper::basename",
4-
"body": "StringHelper::basename(\\$${path}, \\$${suffix = ''})$3",
4+
"body": "StringHelper::basename(\\$${1:path}, \\$${2:suffix = ''})$3",
55
"description": "Returns the trailing name component of a path."
66
},
77
"StringHelper::byteLength": {
88
"prefix": "StringHelper::byteLength",
9-
"body": "StringHelper::byteLength(\\$${string})$3",
9+
"body": "StringHelper::byteLength(\\$${1:string})$2",
1010
"description": "Returns the number of bytes in the given string."
1111
},
1212
"StringHelper::byteSubstr": {
1313
"prefix": "StringHelper::byteSubstr",
14-
"body": "StringHelper::byteSubstr(\\$${string}, \\$${start}, \\$${length = null})$3",
14+
"body": "StringHelper::byteSubstr(\\$${1:string}, \\$${2:start}, \\$${3:length = null})$4",
1515
"description": "Returns the portion of string specified by the start and length parameters."
1616
},
1717
"StringHelper::countWords": {
1818
"prefix": "StringHelper::countWords",
19-
"body": "StringHelper::countWords(\\$${string})$3",
19+
"body": "StringHelper::countWords(\\$${1:string})$2",
2020
"description": "Counts words in a string"
2121
},
2222
"StringHelper::dirname": {
2323
"prefix": "StringHelper::dirname",
24-
"body": "StringHelper::dirname(\\$${path})$3",
24+
"body": "StringHelper::dirname(\\$${1:path})$2",
2525
"description": "Returns parent directory's path."
2626
},
2727
"StringHelper::endsWith": {
2828
"prefix": "StringHelper::endsWith",
29-
"body": "StringHelper::endsWith(\\$${path})$3",
29+
"body": "StringHelper::endsWith(\\$${1:path})$2",
3030
"description": "Check if given string ends with specified substring."
3131
},
3232
"StringHelper::explode": {
3333
"prefix": "StringHelper::explode",
34-
"body": "StringHelper::explode(\\$${string, \\$${delimiter = ','}, \\$${trim = true}, \\$${skipEmpty = false})$3",
34+
"body": "StringHelper::explode(\\$${1:string, \\$${2:delimiter = ','}, \\$${3:trim = ${4|true, false|}}, \\$${5:skipEmpty = ${6|true, false|}})$7",
3535
"description": "Explodes string into array, optionally trims values and skips empty ones"
3636
},
3737
"StringHelper::startsWith": {
3838
"prefix": "StringHelper::startsWith",
39-
"body": "StringHelper::startsWith(\\$${string}, \\$${with}, \\$${caseSensitive = true})$3",
39+
"body": "StringHelper::startsWith(\\$${1:string}, \\$${2:with}, \\$${3:caseSensitive = ${5|true, false|}})$5",
4040
"description": "Check if given string starts with specified substring."
4141
},
4242
"StringHelper::truncate": {
4343
"prefix": "StringHelper::truncate",
44-
"body": "StringHelper::truncate(\\$${string}, \\$${with}, \\$${caseSensitive = true})$3",
44+
"body": "StringHelper::truncate(\\$${1:string}, \\$${2:with}, \\$${3:caseSensitive = ${4|true, false|}})$5",
4545
"description": "Truncates a string to the number of characters specified."
4646
},
4747
"StringHelper::truncateHtml": {
4848
"prefix": "StringHelper::truncateHtml",
49-
"body": "StringHelper::truncateHtml(\\$${string}, \\$${count}, \\$${suffix}, \\$${encoding = false})$3",
49+
"body": "StringHelper::truncateHtml(\\$${1:string}, \\$${2:count}, \\$${3:suffix}, \\$${4:encoding = ${5|true, false|}})$6",
5050
"description": "Truncate a string while preserving the HTML."
5151
},
5252
"StringHelper::truncateWords": {
5353
"prefix": "StringHelper::truncateWords",
54-
"body": "StringHelper::truncateWords(\\$${string}, \\$${count}, \\$${suffix = '...'}, \\$${asHtml = false})$3",
54+
"body": "StringHelper::truncateWords(\\$${1:string}, \\$${2:count}, \\$${3:suffix = '...'}, \\$${4:asHtml = ${5|true, false|}})$6",
5555
"description": "Truncates a string to the number of words specified."
5656
}
5757
}

snippets/helpers/url.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Url::base": {
33
"prefix": "Url::base",
4-
"body": "Url::base(\\$${schema = false})$3",
4+
"body": "Url::base(\\$${1:schema = ${2|true, false|}})$3",
55
"description": "Returns the base URL of the current request."
66
},
77
"Url::canonical": {
@@ -11,42 +11,42 @@
1111
},
1212
"Url::current": {
1313
"prefix": "Url::current",
14-
"body": "Url::current(${['src' => null]})$3",
14+
"body": "Url::current(${['src' => null]})$2",
1515
"description": "Creates a URL by using the current route and the GET parameters."
1616
},
1717
"Url::home": {
1818
"prefix": "Url::home",
19-
"body": "Url::home(\\$${schema = null]})$3",
19+
"body": "Url::home(\\$${1:schema = null]})$3",
2020
"description": "Returns the home URL."
2121
},
2222
"Url::isRelative": {
2323
"prefix": "Url::isRelative",
24-
"body": "Url::isRelative(\\$${url})$3",
24+
"body": "Url::isRelative(\\$${1:url})$2",
2525
"description": "Returns a value indicating whether a URL is relative."
2626
},
2727
"Url::normalizeRoute": {
2828
"prefix": "Url::normalizeRoute",
29-
"body": "Url::normalizeRoute(\\$${route})$3",
29+
"body": "Url::normalizeRoute(\\$${1:route})$2",
3030
"description": "Normalizes route and makes it suitable for UrlManager. Absolute routes are staying as is while relative routes are converted to absolute ones."
3131
},
3232
"Url::previous": {
3333
"prefix": "Url::previous",
34-
"body": "Url::previous(\\$${name = null})$3",
34+
"body": "Url::previous(\\$${1:name = null})$2",
3535
"description": "Returns the URL previously remembered."
3636
},
3737
"Url::remember": {
3838
"prefix": "Url::remember",
39-
"body": "Url::remember(\\$${name = null})$3",
39+
"body": "Url::remember(\\$${1:name = null})$2",
4040
"description": "Remembers the specified URL so that it can be later fetched back by previous()."
4141
},
4242
"Url::to": {
4343
"prefix": "Url::to",
44-
"body": "Url::to(\\$${url}, \\$${schema = false})$3",
44+
"body": "Url::to(\\$${1:url}, \\$${2:schema = ${3|true, false|}})$4",
4545
"description": "Creates a URL based on the given parameters."
4646
},
4747
"Url::toRoute": {
4848
"prefix": "Url::toRoute",
49-
"body": "Url::toRoute(\\$${route}, \\$${schema = false})$3",
49+
"body": "Url::toRoute(\\$${1:route}, \\$${2:schema = ${3|true, false|}})$4",
5050
"description": "Creates a URL for the given route."
5151
}
5252
}

snippets/helpers/var-dumper.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"VarDumper::dump": {
33
"prefix": "VarDumper::dump",
4-
"body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = false})$3",
4+
"body": "VarDumper::dump( \\$${1:var}, \\$${2:depth = 10}, \\$${3:highlight = ${4|true, false|}})$5",
55
"description": "Displays a variable."
66
},
77
"VarDumper::dumpAsString()": {
88
"prefix": "VarDumper::dumpAsString()",
9-
"body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = false})$3",
9+
"body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = ${5|true, false|}})$3",
1010
"description": "Returns the values of a specified column in an array."
1111
},
1212
"VarDumper::export": {
1313
"prefix": "VarDumper::export",
14-
"body": "VarDumper::export(\\$${var})$3",
14+
"body": "VarDumper::export(\\$${1:var})$2",
1515
"description": "Exports a variable as a string representation."
1616
}
1717
}

snippets/jquery.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"js on click" : {
2+
"jsonclick" : {
33
"prefix" : "js on click",
44
"body": [
55
"\\$this->register('",
@@ -11,7 +11,7 @@
1111
],
1212
"description": "js on click"
1313
},
14-
"js on click ajax" : {
14+
"jsonclickajax" : {
1515
"prefix" : "js on click ajax",
1616
"body": [
1717
"\\$this->register('",

snippets/yii.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
},
4747
"Yii::getObjectVars": {
4848
"prefix": "Yii::getObjectVars",
49-
"body": "Yii::getObjectVars(\\$${object});",
49+
"body": "Yii::getObjectVars(\\$${1:object});",
5050
"description": "Returns the public member variables of an object."
5151
},
5252
"Yii::getRootAlias": {
5353
"prefix": "Yii::getRootAlias",
54-
"body": "Yii::getRootAlias(\\$${alias});",
54+
"body": "Yii::getRootAlias(\\$${1:alias});",
5555
"description": "Returns the root alias part of a given alias."
5656
},
5757
"Yii::getVersion": {
@@ -71,12 +71,12 @@
7171
},
7272
"Yii::setAlias": {
7373
"prefix": "Yii::setAlias",
74-
"body": "Yii::setAlias(\\$${alias}, \\$${path});",
74+
"body": "Yii::setAlias(\\$${1:alias}, \\$${2:path});",
7575
"description": "Registers a path alias."
7676
},
7777
"Yii::setLogger": {
7878
"prefix": "Yii::setLogger",
79-
"body": "Yii::setLogger(\\$${logger});",
79+
"body": "Yii::setLogger(\\$${1:logger});",
8080
"description": "Sets the logger object."
8181
},
8282
"Yii::t": {

0 commit comments

Comments
 (0)