add snippets for javascript, markdown, php and xml

This commit is contained in:
Simon Vieille 2019-03-28 13:16:43 +01:00
parent 9699e53627
commit ca892f0fcc
Signed by: deblan
GPG key ID: 03383D15A1D31745
4 changed files with 60 additions and 21 deletions

View file

@ -3,3 +3,9 @@ function $1($2) {
$3
}
endsnippet
snippet cc "function" bi
/**
* $1
*/
endsnippet

View file

@ -7,3 +7,11 @@ endsnippet
snippet img "image" b
![$2]($1 "$2")
endsnippet
snippet fr "Fragment option"
<!-- .element: class="fragment" -->
endsnippet
snippet sl "Slider option"
<!-- .slide: data-menu-title="" data-background-image="" data-transition="" -->
endsnippet

View file

@ -1,5 +1,5 @@
snippet pf "Create a public function" b
/*
/**
* $3.
*
* $4
@ -11,7 +11,7 @@ public function $1($2)
endsnippet
snippet ppf "Create a protected function" b
/*
/**
* $3.
*
* $4
@ -23,7 +23,7 @@ protected function $1($2)
endsnippet
snippet pvf "Create a private function" b
/*
/**
* $3.
*
* $4
@ -41,7 +41,7 @@ $1
endsnippet
snippet gs "Getter and setter"
/*
/**
* Set the value of "$1".
*
* @param $2 \$$1
@ -55,7 +55,7 @@ public function set${1/\w+\s*/\u$0/g}(\$$1)
return \$this;
}
/*
/**
* Get the value of "$1".
*
* @return $2
@ -366,3 +366,19 @@ class $1
$2
}
endsnippet
snippet rest "JMS annotation" b
/**
* @JMS\Serializer\Annotation\SerializedName("$1")
* @JMS\Serializer\Annotation\Groups({"$2"})
* @JMS\Serializer\Annotation\VirtualProperty
*/
public function getRest${1/\w+\s*/\u$0/}()
{
return $this->get${1/\w+\s*/\u$0/}();
}
endsnippet
snippet rest_class "JMS class annotation"
* @JMS\Serializer\Annotation\ExclusionPolicy("all")
endsnippet

View file

@ -8,6 +8,11 @@ endsnippet
snippet schema "schema"
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="default" namespace="$1">
<vendor type="mysql">
<parameter name="Engine" value="InnoDB" />
<parameter name="Charset" value="utf8" />
</vendor>
$2
</database>
endsnippet
@ -37,8 +42,12 @@ snippet id "id"
<column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" />
endsnippet
snippet float "float"
<column name="$1" type="FLOAT" required="false" />
endsnippet
snippet int "int"
<column name="$1" type="INTEGER" required="true" />
<column name="$1" type="INTEGER" required="false" />
endsnippet
snippet varchar "VARCHAR"
@ -54,12 +63,12 @@ snippet longvarchar "LONGVARCHAR"
endsnippet
snippet fk "fk"
<column name="$1_id" type="integer" required="true" />
<column name="$1_id" type="INTEGER" required="true" />
<foreign-key foreignTable="$1" name="fk_$1x" onDelete="cascade" onUpdate="cascade">
<foreign-key foreignTable="$1" onDelete="cascade" onUpdate="cascade">
<reference local="$1_id" foreign="id" />
</foreign-key>
<index name="fk_$1x_idx">
<index>
<index-column name="$1_id" />
</index>
endsnippet