Skip to content

Commit 0cbd17e

Browse files
author
Mombuyish
committed
Merge branch 'develop'
Conflicts: Laravel RESTful.sublime-snippet
2 parents 78d513a + ed94f34 commit 0cbd17e

19 files changed

+154
-199
lines changed

Laravel RESTful.sublime-snippet

Lines changed: 0 additions & 94 deletions
This file was deleted.

Laravel Request.sublime-snippet

Lines changed: 0 additions & 37 deletions
This file was deleted.

README.md

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# sublime-fast-snippets-with-php (Sublime快速片段生成PHP對應Class與Method)
1+
# sublime-fast-snippets-with-php
22

3-
Sublime snippets is powerful function, customize some snippets to create PHP useful method and class.
4-
Sublime片段生成是一個強大的功能,客製化相關片段設置可以快速產生PHP的method與class.
3+
Sublime snippets is powerful functions, customize some snippets to create PHP useful method and class.
54

65

7-
##Installation 安裝
6+
## Installation
87

9-
change directory to your sublime configure local
10-
切換到sublime的設定目錄下,各個作業系統預設路徑如下:
8+
Changing directory to your sublime configure local:
119

1210
ubuntu:
1311
```
@@ -25,55 +23,42 @@ windows:
2523
```
2624

2725
and you can do `git clone`:
28-
接著你可以使用 `git clone`安裝:
2926

3027
```
3128
git clone https://github.com/Mombuyish/sublime-fast-snippets-with-php.git
3229
```
3330
or you can also download `.zip` and unzip, put in there.
34-
或者你可以使用下載`.zip`並且解壓縮放在指定路徑。
3531

36-
##Usage 使用方法
32+
## Usage
3733

3834
Here is customize shortcuts in sublime.
39-
這邊是自訂的快捷鍵。
35+
4036
Support `tab` to previous/next slug.
41-
使用`tab`做上下一步的快速切換。
37+
38+
As you can see, I add new functions , references by PHPStorm.
4239

4340
| shortcut | function |
4441
| --------- |--------------------------------------|
42+
| _c | build construct method |
4543
| class | build class with namespace |
4644
| aclass | build abstract class with namespace |
47-
| _c | build construct method |
48-
| met | build method |
49-
50-
| 快捷鍵 | 功用 |
51-
| --------- |-------------------------------------- |
52-
| class | 建立含有namespace的class |
53-
| aclass | 建立含有namespace的抽象class |
54-
| _c | 建立construct方法 |
55-
| met | 建立方法(可透過tab進行修改公開保護私有) |
56-
57-
And also, support Laravel 5.1~ shortcuts.
58-
當然,也有支援Laravel 5.1的快捷鍵
59-
60-
###Laravel 5.1
61-
| shortcut | function |
62-
| --------- |--------------------------------------|
63-
| larac | build laravel controller (plain) |
64-
| laram | build laravel model |
65-
| larar | build laravel request |
66-
| rest | build laravel controller on RESTful |
67-
68-
| 快捷鍵 | 功用 |
69-
| --------- |--------------------------------------|
70-
| larac | 建立空白的controller |
71-
| laram | 建立model |
72-
| larar | 建立request |
73-
| rest | 建RESTful controller |
74-
75-
##Notice 注意事項
45+
| echo | echo |
46+
| fore | foreach |
47+
| forek | foreach with key |
48+
| inc | include |
49+
| inco | include_once |
50+
| prif | build private method |
51+
| prisf | build private static method |
52+
| prof | build protected method |
53+
| prosf | build protected static method |
54+
| pubf | build public method |
55+
| pubsf | build public static method |
56+
| rqr | require |
57+
| rqro | require_once |
58+
| thr | throw new... |
59+
60+
61+
## Notice
7662
Those shortcuts are active `.php` file, Use `<?php` to define the file type.
77-
這些快捷鍵僅在`.php`檔案,並且開頭必須是`<?php`定義這個檔案的類型才有作用。
7863

7964
Enjoy it.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<snippet>
22
<content><![CDATA[
3-
public function __construct(${1})
3+
public function __construct(${1:\$PARAMETERS})
44
{
55
${2}
66
}
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<snippet>
22
<content><![CDATA[
3-
${1:public} function ${2:FunctionName}(${3:\$value} = ${4:''})
4-
{
5-
${5}
6-
}
3+
echo ${1};
74
]]></content>
85
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
9-
<tabTrigger>met</tabTrigger>
6+
<tabTrigger>eco</tabTrigger>
107
<!-- Optional: Set a scope to limit where the snippet will trigger -->
118
<scope>source.php</scope>
129
</snippet>
10+
11+

foreach with key.sublime-snippet

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<snippet>
2+
<content><![CDATA[
3+
foreach (${1:\$array} as ${2:\$key} => ${3:\$value}) {
4+
${4}
5+
}
6+
]]></content>
7+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
8+
<tabTrigger>forek</tabTrigger>
9+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
10+
<scope>source.php</scope>
11+
</snippet>

foreach.sublime-snippet

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<snippet>
2+
<content><![CDATA[
3+
foreach (${1:\$array} as ${2:\$value}) {
4+
${3}
5+
}
6+
]]></content>
7+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
8+
<tabTrigger>fore</tabTrigger>
9+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
10+
<scope>source.php</scope>
11+
</snippet>

include.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
include "${1}";
4+
]]></content>
5+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
6+
<tabTrigger>inc</tabTrigger>
7+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
8+
<scope>source.php</scope>
9+
</snippet>

include_once.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<content><![CDATA[
3+
include_once "${1}";
4+
]]></content>
5+
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
6+
<tabTrigger>inco</tabTrigger>
7+
<!-- Optional: Set a scope to limit where the snippet will trigger -->
8+
<scope>source.php</scope>
9+
</snippet>

0 commit comments

Comments
 (0)