sublime 快速设置getter and setter

作者: dreamfly 分类: 未分类 发布时间: 2015-04-12 15:09

新建snippet,添加如下代码:

<snippet>
   <content><![CDATA[public function get${1/(.*)/\u$1/}()
{
   return $this->${1:$SELECTION};
}

public function set${1/(.*)/\u$1/}($$1)
{
   $this->$1 = $$1;
   return $this;
}
]]></content>
   <!-- Optional: Tab trigger to activate the snippet -->
   <tabTrigger>getset</tabTrigger>
   <!-- Optional: Scope the tab trigger will be active in -->
   <scope>source.php</scope>
   <!-- Optional: Description to show in the menu -->
   <description>Create getter and setter methods</description>
</snippet>

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

评论已关闭!