Added Symfony2 use.. snippets

This commit is contained in:
Konstantin 2015-06-26 15:27:09 +03:00
parent 69c918175c
commit 18d1fc346c
No known key found for this signature in database
GPG Key ID: A0A390CEBDCD7AF0

View File

@ -278,6 +278,55 @@ snip.rv = re.match(r'.*(?=\.)', fn).group()
}
endsnippet
snippet redir "Symfony2 redirect"
snippet redir "Symfony2 redirect" b
$this->redirect($this->generateUrl('${1}', ${2}));
endsnippet
snippet usecontroller "Symfony2 use Symfony\..\Controller" b
use Symfony\Bundle\FrameworkBundle\Controller\Controller;${1}
endsnippet
snippet usereauest "Symfony2 use Symfony\..\Request" b
use Symfony\Component\HttpFoundation\Request;${1}
endsnippet
snippet useroute "Symfony2 use Sensio\..\Route" b
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;${1}
endsnippet
snippet useresponse "Symfony2 use Symfony\..\Response" b
use Symfony\Component\HttpFoundation\Response;${1}
endsnippet
snippet usefile "Symfony2 use Symfony\..\File" b
use Symfony\Component\HttpFoundation\File\UploadedFile;${1}
endsnippet
snippet useassert "Symfony2 use Symfony\..\Constraints as Assert" b
use Symfony\Component\Validator\Constraints as Assert;${1}
endsnippet
snippet usetemplate "Symfony2 use Sensio\..\Template" b
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;${1}
endsnippet
snippet usecache "Symfony2 use Sensio\..\Cache" b
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;${1}
endsnippet
snippet usemethod "Symfony2 use Sensio\..\Method" b
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;${1}
endsnippet
snippet usearray "Symfony2 use Doctrine\..\ArrayCollection" b
use Doctrine\Common\Collections\ArrayCollection;${1}
endsnippet
snippet useorm "Symfony2 use Doctrine\..\Mapping as ORM" b
use Doctrine\ORM\Mapping as ORM;${1}
endsnippet
snippet usesecure "Symfony2 use JMS\..\Secure" b
use JMS\SecurityExtraBundle\Annotation\Secure;${1}
endsnippet