PHP snippet
This commit is contained in:
parent
f9baea9873
commit
f3c4382b05
|
@ -85,7 +85,12 @@ endsnippet
|
||||||
snippet page "Create trinity page"
|
snippet page "Create trinity page"
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
`!p snip.rv = os.popen('/home/simon/bin/namespace ' + path).readline().strip()`
|
namespace `!p
|
||||||
|
relpath = os.path.relpath(path)
|
||||||
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
||||||
|
if m:
|
||||||
|
snip.rv = m.group().replace('/', '\\')
|
||||||
|
`;
|
||||||
|
|
||||||
use Trinity\Bundle\ContentManagerBundle\Model\Page;
|
use Trinity\Bundle\ContentManagerBundle\Model\Page;
|
||||||
use Trinity\Bundle\ContentManagerBundle\Model\Block;
|
use Trinity\Bundle\ContentManagerBundle\Model\Block;
|
||||||
|
@ -169,7 +174,12 @@ endsnippet
|
||||||
snippet command "Create sf2 command"
|
snippet command "Create sf2 command"
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
`!p snip.rv = os.popen('/home/simon/bin/namespace ' + path).readline().strip()`
|
namespace `!p
|
||||||
|
relpath = os.path.relpath(path)
|
||||||
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
||||||
|
if m:
|
||||||
|
snip.rv = m.group().replace('/', '\\')
|
||||||
|
`;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
@ -214,7 +224,12 @@ endsnippet
|
||||||
snippet controller "Create trinity controller"
|
snippet controller "Create trinity controller"
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
`!p snip.rv = os.popen('/home/simon/bin/namespace ' + path).readline().strip()`
|
namespace `!p
|
||||||
|
relpath = os.path.relpath(path)
|
||||||
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
||||||
|
if m:
|
||||||
|
snip.rv = m.group().replace('/', '\\')
|
||||||
|
`;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Trinity\Bundle\ContentManagerBundle\Controller\PageController;
|
use Trinity\Bundle\ContentManagerBundle\Controller\PageController;
|
||||||
|
@ -248,7 +263,12 @@ endsnippet
|
||||||
snippet form "Create sf2 form"
|
snippet form "Create sf2 form"
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
`!p snip.rv = os.popen('/home/simon/bin/namespace ' + path).readline().strip()`
|
namespace `!p
|
||||||
|
relpath = os.path.relpath(path)
|
||||||
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
||||||
|
if m:
|
||||||
|
snip.rv = m.group().replace('/', '\\')
|
||||||
|
`;
|
||||||
|
|
||||||
use Propel\PropelBundle\Form\BaseAbstractType;
|
use Propel\PropelBundle\Form\BaseAbstractType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
@ -329,7 +349,12 @@ endsnippet
|
||||||
snippet class "Class" b
|
snippet class "Class" b
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
`!p snip.rv = os.popen('/home/simon/bin/namespace ' + path).readline().strip()`
|
namespace `!p
|
||||||
|
relpath = os.path.relpath(path)
|
||||||
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
||||||
|
if m:
|
||||||
|
snip.rv = m.group().replace('/', '\\')
|
||||||
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class $1.
|
* class $1.
|
||||||
|
|
Loading…
Reference in a new issue