Just some peace of code that helps us in work.
git clone [email protected]:EvercodeLab/sublime2-snippets.git \
~/Library/Application\ Support/Sublime\ Text\ 2/Packages/EvercodeSnippetPack
git clone [email protected]:EvercodeLab/sublime2-snippets.git \
~/.config/sublime-text-2/Packages/EvercodeSnippetPack
<%
=><% %>
erb
=><%= %>
seems wierd at first, but is easy to type with just left handif
=> if-endife
=> if-else-endcase
=> case-when-when-endwhen
=> wheneach
=> object-each-do-endtap
=> object-tap-do-endtry
=> object-try-do-endformfor
=> form-forimgtag
=> image-taglinkto
=> link-to
docready
: jQuery document ready functionconsole
: console.log() function — help debug JavaScriptanonymous-function
: anonymous functionon
: jQueryon
function, 'click' by default
itsrt
=> it-should-respond-toitsbt
=> it-should-belong-toitshm
=> it-should-have-manyitshabtm
=> it-should-have-and-belong-to-manyits
=> its-property-should
match
=> match-path-actionget
=> get-pathpost
=> post-pathres
=> resourcesro
=> resources-onlyre
=> resources-except
sf-crud-controller
: generate whole CRUD controllersf-controller-with-annotation
: controller with annotationssf-action-with-annotation
: action annotated with @Route and @Templatesf-em
: getting Entity Manager in Controllersf-get-repository
: getting repository with Entity managersf-get-user-from-security-context
: get User information from security.contextsf-redirect
: redirectsf-flash
: flash messagesf-403
: throwing 403 exceptionsf-404
: throwing 404 exception
sf-entity-class
: generates entity classsf-orm-column
: generates ORM column defenitionsf-orm-column-with-set-and-get
: generates ORM column defenition with setter and gettersf-repository-class
: generates entity repository classsf-query-builder
: generate query buildersf-setter-and-getter
: setter and getter methodssf-setter
: setteresf-getter
: getter
sf-form-type
: creates form type classsf-cnoice-list-class
: creates choice list class
For basic Twig functions use PHP Twig. It provide next snippets:
}}
:{{ }}
%%
:{% %}
block
:{% block name %}{% endblock %}
blockb
: block with blank lineextends
:{% extends 'template' %}
filter
:{% filter name %}{% endfilter %}
filterb
: filter with blank linefor
:{% for item in seq %}
fore
: for with elseif
:{% if condition %}{% endif %}
ifb
: same asif
but with blank lineife
: same asif
but with else statementelse
:{% else %}
set
:{% set var = value %}
setb
: same asset
but in other syntax
And here some more Twig snippets:
twig-path
: path functiontwig-include
: include other templatetwig-render
: render other templatetwig-spaceless
: render peace of templte without spaces
sf-sonata-admin-class
: creates SonataAdmin class
sf-service
: yml service defenitionsf-service-admin
: yml admin service defenition
class
: just PHP classphp
: PHP open tagpubfun
: public functionprivfun
: private functionprotfun
: protected function
snippet
: just for generation of other snippets
More to come. Stay tuned.