Snippets

Alessandro Pagnin Sublime snippet, PHP get/set generator

Created by Alessandro Pagnin
<snippet>
    <content><![CDATA[public function get${1/^(\w)|(?:_(\w))/(?1\u$1:)(?2\u$2:)/g}()
{
    return \$this->${1};
}

public function set${1/^(\w)|(?:_(\w))/(?1\u$1:)(?2\u$2:)/g}(\$${1})
{
    \$this->${1} = \$${1};
    return \$this;
}

]]></content>
    <tabTrigger>getset</tabTrigger>
    <scope>source.php</scope>
    <description>Create getter and setter methods</description>
</snippet>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.