-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp.snippets
44 lines (35 loc) · 947 Bytes
/
php.snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
priority -40
snippet i "<?php ?>" iw
<?php ${1:code} ?>$0
endsnippet
snippet ? "<?php" b
<?php
${1:code}
?>$0
endsnippet
# NOTE: special punctuation can't be declared `w` option because it is not a
# boundary of word.
snippet = "<?= ?>" i
<?= ${1:code}; ?>$0
endsnippet
snippet echoln "echo with newline in html" w
echo ${1:code}${1/.+/ \. /}'<br />';$0
endsnippet
snippet "\$i([^a-zA-Z])" "avoid snippet expansion for PHP and html" riA
$j`!p snip.rv = match.group(1)`$0
endsnippet
snippet .. "=>" iA
=>
endsnippet
snippet CI_construct "CI constructor" b
function __construct() {
parent::__construct();${1}
}$0
endsnippet
snippet CI_defined_or_exit "CI defined or exit" b
defined('BASEPATH') OR exit('No direct script access allowed');$0
endsnippet
# In case of `return` will be expanded in "html.snippet".
snippet CI_db_query "CI db query" iw
${1:return}${1/.+/ /}$this->db->query(${2:$sql})${3/.+/->/}${3:result_array()};$0
endsnippet