Maison >développement back-end >tutoriel php >sublime编辑器怎么快速输入PHP头部版本声明
sublime编辑器如何快速输入PHP头部版本声明
Sublime 菜单栏->Tools→New Snippet→得到如下图内容:
输入以下内容:
<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><snippet<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span> <span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><content<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5"><![CDATA[</span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5"><?php</span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5">/**</span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5"> * @version 1.0</span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5"> * @author xinhua3</span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5"> * @date </span><span class="sc2" style="margin:0px; padding:0px; line-height:1.5"> */</span> <span class="sc2" style="margin:0px; padding:0px; line-height:1.5">]]></span><span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"></content<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span><span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><tabTrigger<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span>phpheader<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"></tabTrigger<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span><span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><description<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span>phpheader<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"></description<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span><span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"></snippet<span class="re2" style="margin:0px; padding:0px; line-height:1.5">></span></span></span>
<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><span class="re2" style="margin:0px; padding:0px; line-height:1.5"><span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:13px; line-height:19.5px; background-color:rgb(254,254,242)">然后保存文件名为phpheader.sublime-snippet,保存到指定路径,如图2</span></span></span></span>
<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><span class="re2" style="margin:0px; padding:0px; line-height:1.5"><span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:13px; line-height:19.5px; background-color:rgb(254,254,242)"><img src="/img/2014/06/09/14023081.jpg" alt=""></span></span></span></span>
<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><span class="re2" style="margin:0px; padding:0px; line-height:1.5"><span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:13px; line-height:19.5px; background-color:rgb(254,254,242)"></span></span></span></span>
<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><span class="re2" style="margin:0px; padding:0px; line-height:1.5"><span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:13px; line-height:19.5px; background-color:rgb(254,254,242)">然后打开一个新的文件,在文件的开头输入phpheader再按tab按键,那么此时php头部文件即可生成,如图</span></span></span></span>
<span class="sc3" style="margin:0px; padding:0px; line-height:1.5"><span class="re1" style="margin:0px; padding:0px; line-height:1.5; color:rgb(0,0,255)"><span class="re2" style="margin:0px; padding:0px; line-height:1.5"><span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:13px; line-height:19.5px; background-color:rgb(254,254,242)"><img src="/img/2014/06/09/14023082.jpg" alt=""></span></span></span></span>