Skip to content

Commit

Permalink
updated some issues related to snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
imanilchaudhari committed Dec 22, 2017
1 parent 348cd90 commit 2e7adee
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 56 deletions.
8 changes: 4 additions & 4 deletions snippets/helpers/file-helper.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"FileHelper::createDirectory": {
"prefix": "FileHelper::createDirectory",
"body": "FileHelper::createDirectory(\\$${path}, \\$${mode = 509}, \\$${recursive = true})$3",
"body": "FileHelper::createDirectory(\\$${path}, \\$${mode = 509}, \\$${recursive = ${5|true, false|}})$3",
"description": "Creates a new directory."
},
"FileHelper::filterPath": {
Expand All @@ -26,7 +26,7 @@
},
"FileHelper::getMimeType": {
"prefix": "FileHelper::getMimeType",
"body": "FileHelper::getMimeType(\\$${file}, \\$${magicFile = null}, \\$${checkedExtension = true})$3",
"body": "FileHelper::getMimeType(\\$${file}, \\$${magicFile = null}, \\$${checkedExtension = ${5|true, false|}})$3",
"description": "Determines the MIME type of the specified file."
},
"FileHelper::getMimeTypeByExtension": {
Expand All @@ -36,12 +36,12 @@
},
"FileHelper::loadMimeTypes": {
"prefix": "FileHelper::loadMimeTypes",
"body": "FileHelper::loadMimeTypes(\\$${magicFile})$3",
"body": "FileHelper::loadMimeTypes(\\$${1:magicFile})$2",
"description": "Loads MIME types from the specified file."
},
"FileHelper::localize": {
"prefix": "FileHelper::localize",
"body": "FileHelper::localize(\\$${file}, \\$${language = null}, \\$${sourceLanguage = null})$3",
"body": "FileHelper::localize(\\$${1:file}, \\$${2:language = null}, \\$${3:sourceLanguage = null})$4",
"description": "Returns the localized version of a specified file."
},
"FileHelper::normalizePath": {
Expand Down
28 changes: 14 additions & 14 deletions snippets/helpers/html.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"Html::a": {
"prefix": "Html::a",
"body": "Html::a(\\$${text}, \\$${url}, \\$${options = []})$3",
"body": "Html::a(\\$${1:text}, \\$${2:url}, \\$${3:options = []})$4",
"description": "Generates a hyperlink tag."
},
"Html::activeBooleanInput": {
"prefix": "Html::activeBooleanInput",
"body": "Html::activeBooleanInput(\\$${type}, \\$${model}, \\$${attribute}, \\$${options = []})$3",
"body": "Html::activeBooleanInput(\\$${1:type}, \\$${2:model}, \\$${3:attribute}, \\$${4:options = []})$5",
"description": "Generates a boolean input This method is mainly called by activeCheckbox() and activeRadio()."
},
"Html::activeCheckbox": {
"prefix": "Html::activeCheckbox",
"body": "Html::activeCheckbox(\\$${model}, \\$${attribute}, \\$${options = []})$3",
"body": "Html::activeCheckbox(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
"description": "Generates a checkbox tag together with a label for the given model attribute."
},
"Html::activeCheckboxList": {
"prefix": "Html::activeCheckboxList",
"body": "Html::activeCheckboxList(\\$${model}, \\$${attribute}, \\$${items}, \\$${options = []})$3",
"body": "Html::activeCheckboxList(\\$${1:model}, \\$${2:attribute}, \\$${3:items}, \\$${4:options = []})$5",
"description": "Generates a list of checkboxes."
},
"Html::activeDropDownList": {
"prefix": "Html::activeDropDownList",
"body": "Html::activeDropDownList(\\$${model}, \\$${attribute}, \\$${items}, \\$${options = []})$3",
"body": "Html::activeDropDownList(\\$${1:model}, \\$${2:attribute}, \\$${3:items}, \\$${4:options = []})$5",
"description": "Generates a drop-down list for the given model attribute."
},
"Html::activeFileInput": {
"prefix": "Html::activeFileInput",
"body": "Html::activeFileInput(\\$${model}, \\$${attribute}, \\$${options = []})$3",
"body": "Html::activeFileInput(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
"description": "Generates a file input tag for the given model attribute."
},
"Html::activeHiddenInput": {
"prefix": "Html::activeHiddenInput",
"body": "Html::activeHiddenInput(\\$${model}, \\$${attribute}, \\$${options = []})$3",
"body": "Html::activeHiddenInput(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
"description": "Generates a hidden input tag for the given model attribute."
},
"Html::activeHint": {
"prefix": "Html::activeHint",
"body": "Html::activeHint(\\$${model}, \\$${attribute}, \\$${options = []})$3",
"body": "Html::activeHint(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
"description": "Generates a hint tag for the given model attribute."
},
"Html::activeInput": {
Expand Down Expand Up @@ -131,7 +131,7 @@
},
"Html::cssFile": {
"prefix": "Html::cssFile",
"body": "Html::cssFile(\\$${url}, \\$${options = []})$3",
"body": "Html::cssFile(\\$${1:url}, \\$${1:options = []})$3",
"description": "Generates a link tag that refers to an external CSS file."
},
"Html::cssStyleFromArray": {
Expand All @@ -146,17 +146,17 @@
},
"Html::decode": {
"prefix": "Html::decode",
"body": "Html::decode($content})$3",
"body": "Html::decode(\\$${1:content})$2",
"description": "Decodes special HTML entities back to the corresponding characters."
},
"Html::dropDownList": {
"prefix": "Html::dropDownList",
"body": "Html::dropDownList($name}, \\$${selection = null}, \\$${items = []}, \\$${options = []})$3",
"body": "Html::dropDownList(\\$${1:name}, \\$${2:selection = null}, \\$${3:items = []}, \\$${4:options = []})$5",
"description": "Generates a drop-down list."
},
"Html::encode": {
"prefix": "Html::encode",
"body": "Html::encode($content}, \\$${doubleEncode = true})$3",
"body": "Html::encode(\\$${1:content}, \\$${2:doubleEncode = true})$3",
"description": "Encodes special characters into HTML entities."
},
"Html::endForm": {
Expand All @@ -166,12 +166,12 @@
},
"Html::endTag": {
"prefix": "Html::endTag",
"body": "Html::endTag($name})$3",
"body": "Html::endTag(\\$${1:name})$2",
"description": "Generates an end tag."
},
"Html::error": {
"prefix": "Html::error",
"body": "Html::error($model, \\$${attribute}, \\$${options = []})$3",
"body": "Html::error(\\$${1:model}, \\$${2:attribute}, \\$${3:options = []})$4",
"description": "Generates a tag that contains the first validation error of the specified model attribute."
}
}
12 changes: 6 additions & 6 deletions snippets/helpers/inflector.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"Inflector::ordinalize": {
"prefix": "Inflector::ordinalize",
"body": "Inflector::ordinalize(\\$${number})$3",
"body": "Inflector::ordinalize(\\$${1:number})$2",
"description": "Ordinalize number."
},
"Inflector::pluralize": {
Expand All @@ -46,7 +46,7 @@
},
"Inflector::singularize": {
"prefix": "Inflector::singularize",
"body": "Inflector::singularize(\\$${word})$3",
"body": "Inflector::singularize(\\$${1:word})$2",
"description": "Singularize word."
},
"Inflector::slug": {
Expand All @@ -56,7 +56,7 @@
},
"Inflector::tableize": {
"prefix": "Inflector::tableize",
"body": "Inflector::tableize(\\$${className})$3",
"body": "Inflector::tableize(\\$${1:className})$2",
"description": "Creats a tableize string."
},
"Inflector::titleize": {
Expand All @@ -66,17 +66,17 @@
},
"Inflector::transliterate": {
"prefix": "Inflector::transliterate",
"body": "Inflector::transliterate(\\$${1:string}, \\$${2:transliterator ${5|true, false|}})$3",
"body": "Inflector::transliterate(\\$${1:string}, \\$${2:transliterator ${3|true, false|}})$4",
"description": "Creats a transliterate string."
},
"Inflector::underscore": {
"prefix": "Inflector::underscore",
"body": "Inflector::underscore(\\$${words})$3",
"body": "Inflector::underscore(\\$${1:words})$2",
"description": "Creats a underscore string."
},
"Inflector::variablize": {
"prefix": "Inflector::variablize",
"body": "Inflector::variablize(\\$${word})$3",
"body": "Inflector::variablize(\\$${1:word})$2",
"description": "Creats a variablize string."
}
}
6 changes: 3 additions & 3 deletions snippets/helpers/json.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"Json::decode": {
"prefix": "Json::decode",
"body": "Json::decode(\\$${json}, \\$${asArray = true})$3",
"body": "Json::decode(\\$${1:json}, \\$${2:asArray = ${3|true, false|}})$4",
"description": "Decodes the given JSON string into a PHP data structure."
},
"Json::encode": {
"prefix": "Json::encode",
"body": "Json::encode(\\$${json}, \\$${asArray = true})$3",
"body": "Json::encode(\\$${1:json}, \\$${2:asArray = ${3|true, false|}})$4",
"description": "Encodes the given value into a JSON string."
},
"Json::htmlEncode": {
"prefix": "Json::htmlEncode",
"body": "Json::htmlEncode(\\$${value})$3",
"body": "Json::htmlEncode(\\$${1:value})$2",
"description": "Encodes the given value into a JSON string HTML-escaping entities so it is safe to be embedded in HTML code."
}
}
22 changes: 11 additions & 11 deletions snippets/helpers/string-helper.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
{
"StringHelper::basename": {
"prefix": "StringHelper::basename",
"body": "StringHelper::basename(\\$${path}, \\$${suffix = ''})$3",
"body": "StringHelper::basename(\\$${1:path}, \\$${2:suffix = ''})$3",
"description": "Returns the trailing name component of a path."
},
"StringHelper::byteLength": {
"prefix": "StringHelper::byteLength",
"body": "StringHelper::byteLength(\\$${string})$3",
"body": "StringHelper::byteLength(\\$${1:string})$2",
"description": "Returns the number of bytes in the given string."
},
"StringHelper::byteSubstr": {
"prefix": "StringHelper::byteSubstr",
"body": "StringHelper::byteSubstr(\\$${string}, \\$${start}, \\$${length = null})$3",
"body": "StringHelper::byteSubstr(\\$${1:string}, \\$${2:start}, \\$${3:length = null})$4",
"description": "Returns the portion of string specified by the start and length parameters."
},
"StringHelper::countWords": {
"prefix": "StringHelper::countWords",
"body": "StringHelper::countWords(\\$${string})$3",
"body": "StringHelper::countWords(\\$${1:string})$2",
"description": "Counts words in a string"
},
"StringHelper::dirname": {
"prefix": "StringHelper::dirname",
"body": "StringHelper::dirname(\\$${path})$3",
"body": "StringHelper::dirname(\\$${1:path})$2",
"description": "Returns parent directory's path."
},
"StringHelper::endsWith": {
"prefix": "StringHelper::endsWith",
"body": "StringHelper::endsWith(\\$${path})$3",
"body": "StringHelper::endsWith(\\$${1:path})$2",
"description": "Check if given string ends with specified substring."
},
"StringHelper::explode": {
"prefix": "StringHelper::explode",
"body": "StringHelper::explode(\\$${string, \\$${delimiter = ','}, \\$${trim = true}, \\$${skipEmpty = false})$3",
"body": "StringHelper::explode(\\$${1:string, \\$${2:delimiter = ','}, \\$${3:trim = ${4|true, false|}}, \\$${5:skipEmpty = ${6|true, false|}})$7",
"description": "Explodes string into array, optionally trims values and skips empty ones"
},
"StringHelper::startsWith": {
"prefix": "StringHelper::startsWith",
"body": "StringHelper::startsWith(\\$${string}, \\$${with}, \\$${caseSensitive = true})$3",
"body": "StringHelper::startsWith(\\$${1:string}, \\$${2:with}, \\$${3:caseSensitive = ${5|true, false|}})$5",
"description": "Check if given string starts with specified substring."
},
"StringHelper::truncate": {
"prefix": "StringHelper::truncate",
"body": "StringHelper::truncate(\\$${string}, \\$${with}, \\$${caseSensitive = true})$3",
"body": "StringHelper::truncate(\\$${1:string}, \\$${2:with}, \\$${3:caseSensitive = ${4|true, false|}})$5",
"description": "Truncates a string to the number of characters specified."
},
"StringHelper::truncateHtml": {
"prefix": "StringHelper::truncateHtml",
"body": "StringHelper::truncateHtml(\\$${string}, \\$${count}, \\$${suffix}, \\$${encoding = false})$3",
"body": "StringHelper::truncateHtml(\\$${1:string}, \\$${2:count}, \\$${3:suffix}, \\$${4:encoding = ${5|true, false|}})$6",
"description": "Truncate a string while preserving the HTML."
},
"StringHelper::truncateWords": {
"prefix": "StringHelper::truncateWords",
"body": "StringHelper::truncateWords(\\$${string}, \\$${count}, \\$${suffix = '...'}, \\$${asHtml = false})$3",
"body": "StringHelper::truncateWords(\\$${1:string}, \\$${2:count}, \\$${3:suffix = '...'}, \\$${4:asHtml = ${5|true, false|}})$6",
"description": "Truncates a string to the number of words specified."
}
}
18 changes: 9 additions & 9 deletions snippets/helpers/url.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Url::base": {
"prefix": "Url::base",
"body": "Url::base(\\$${schema = false})$3",
"body": "Url::base(\\$${1:schema = ${2|true, false|}})$3",
"description": "Returns the base URL of the current request."
},
"Url::canonical": {
Expand All @@ -11,42 +11,42 @@
},
"Url::current": {
"prefix": "Url::current",
"body": "Url::current(${['src' => null]})$3",
"body": "Url::current(${['src' => null]})$2",
"description": "Creates a URL by using the current route and the GET parameters."
},
"Url::home": {
"prefix": "Url::home",
"body": "Url::home(\\$${schema = null]})$3",
"body": "Url::home(\\$${1:schema = null]})$3",
"description": "Returns the home URL."
},
"Url::isRelative": {
"prefix": "Url::isRelative",
"body": "Url::isRelative(\\$${url})$3",
"body": "Url::isRelative(\\$${1:url})$2",
"description": "Returns a value indicating whether a URL is relative."
},
"Url::normalizeRoute": {
"prefix": "Url::normalizeRoute",
"body": "Url::normalizeRoute(\\$${route})$3",
"body": "Url::normalizeRoute(\\$${1:route})$2",
"description": "Normalizes route and makes it suitable for UrlManager. Absolute routes are staying as is while relative routes are converted to absolute ones."
},
"Url::previous": {
"prefix": "Url::previous",
"body": "Url::previous(\\$${name = null})$3",
"body": "Url::previous(\\$${1:name = null})$2",
"description": "Returns the URL previously remembered."
},
"Url::remember": {
"prefix": "Url::remember",
"body": "Url::remember(\\$${name = null})$3",
"body": "Url::remember(\\$${1:name = null})$2",
"description": "Remembers the specified URL so that it can be later fetched back by previous()."
},
"Url::to": {
"prefix": "Url::to",
"body": "Url::to(\\$${url}, \\$${schema = false})$3",
"body": "Url::to(\\$${1:url}, \\$${2:schema = ${3|true, false|}})$4",
"description": "Creates a URL based on the given parameters."
},
"Url::toRoute": {
"prefix": "Url::toRoute",
"body": "Url::toRoute(\\$${route}, \\$${schema = false})$3",
"body": "Url::toRoute(\\$${1:route}, \\$${2:schema = ${3|true, false|}})$4",
"description": "Creates a URL for the given route."
}
}
6 changes: 3 additions & 3 deletions snippets/helpers/var-dumper.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"VarDumper::dump": {
"prefix": "VarDumper::dump",
"body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = false})$3",
"body": "VarDumper::dump( \\$${1:var}, \\$${2:depth = 10}, \\$${3:highlight = ${4|true, false|}})$5",
"description": "Displays a variable."
},
"VarDumper::dumpAsString()": {
"prefix": "VarDumper::dumpAsString()",
"body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = false})$3",
"body": "VarDumper::dump( \\$${var}, \\$${depth = 10}, \\$${highlight = ${5|true, false|}})$3",
"description": "Returns the values of a specified column in an array."
},
"VarDumper::export": {
"prefix": "VarDumper::export",
"body": "VarDumper::export(\\$${var})$3",
"body": "VarDumper::export(\\$${1:var})$2",
"description": "Exports a variable as a string representation."
}
}
4 changes: 2 additions & 2 deletions snippets/jquery.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"js on click" : {
"jsonclick" : {
"prefix" : "js on click",
"body": [
"\\$this->register('",
Expand All @@ -11,7 +11,7 @@
],
"description": "js on click"
},
"js on click ajax" : {
"jsonclickajax" : {
"prefix" : "js on click ajax",
"body": [
"\\$this->register('",
Expand Down
8 changes: 4 additions & 4 deletions snippets/yii.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
},
"Yii::getObjectVars": {
"prefix": "Yii::getObjectVars",
"body": "Yii::getObjectVars(\\$${object});",
"body": "Yii::getObjectVars(\\$${1:object});",
"description": "Returns the public member variables of an object."
},
"Yii::getRootAlias": {
"prefix": "Yii::getRootAlias",
"body": "Yii::getRootAlias(\\$${alias});",
"body": "Yii::getRootAlias(\\$${1:alias});",
"description": "Returns the root alias part of a given alias."
},
"Yii::getVersion": {
Expand All @@ -71,12 +71,12 @@
},
"Yii::setAlias": {
"prefix": "Yii::setAlias",
"body": "Yii::setAlias(\\$${alias}, \\$${path});",
"body": "Yii::setAlias(\\$${1:alias}, \\$${2:path});",
"description": "Registers a path alias."
},
"Yii::setLogger": {
"prefix": "Yii::setLogger",
"body": "Yii::setLogger(\\$${logger});",
"body": "Yii::setLogger(\\$${1:logger});",
"description": "Sets the logger object."
},
"Yii::t": {
Expand Down

0 comments on commit 2e7adee

Please sign in to comment.