Skip to content

Instantly share code, notes, and snippets.

@JonTheWhite
Created November 19, 2011 18:43
Show Gist options
  • Save JonTheWhite/1379203 to your computer and use it in GitHub Desktop.
Save JonTheWhite/1379203 to your computer and use it in GitHub Desktop.
Aptana snippets
with_defaults :scope => 'source.php source.php.embedded.block.html' do
snippet 'Core_Debug::dumps ...' do |s|
s.trigger = 'dar'
s.expansion = '\Core_Debug::dumps($1);'
s.scope = 'source.php'
end
snippet 'Core_Debug::dumps ... exit' do |s|
s.trigger = 'edar'
s.expansion = '\Core_Debug::dumps($1);exit;'
s.scope = 'source.php'
end
snippet 'get() set()' do |s|
s.trigger = 'getset'
s.scope = 'source.php'
s.expansion = '/**
* Gets the ${2:param}.
*
* @return
*/
public function get${1:Method}()
{
if (empty(\$this->_${2:param})) {
\$this->_${2:param} = Core_Di_Container::${1:Method}();
}
return \$this->_${2:param};
}
/**
* Sets the ${2:param}.
*
* @param \$${2:param}
* @return \$this.
*/
public function set${1:Method}(\$${2:param})
{
\$this->_${2:param} = \$${2:param};
return \$this;
}$0'
end
snippet 'entity get() set()' do |s|
s.trigger = 'entitygetset'
s.scope = 'source.php'
s.expansion = '/**
* Get ${2:param}.
*
* @return ${3:type}
*/
public function get${1:Method}()
{
return \$this->${2:param};
}
/**
* Sets the ${2:param}.
*
* @param ${3:type} \$${2:param}
* @return App\Model\Entity${4:entity} \$this.
*/
public function set${1:Method}(\$${2:param})
{
\$this->${2:param} = \$${2:param};
return \$this;
}$0'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment