Snippets
This commit is contained in:
parent
a3b5800c8c
commit
04c8f4f961
5
vim/UltiSnips/javascript.snippets
Normal file
5
vim/UltiSnips/javascript.snippets
Normal file
|
@ -0,0 +1,5 @@
|
|||
snippet fn "function" bi
|
||||
function $1($2) {
|
||||
$3
|
||||
}
|
||||
endsnippet
|
|
@ -1,29 +1,53 @@
|
|||
snippet pf "Create a public function" b
|
||||
public function $1()
|
||||
/*
|
||||
* $3.
|
||||
*
|
||||
* $4
|
||||
*/
|
||||
public function $1($2)
|
||||
{
|
||||
return $this;
|
||||
$5
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ppf "Create a private function" b
|
||||
public function $1()
|
||||
snippet ppf "Create a protected function" b
|
||||
/*
|
||||
* $3.
|
||||
*
|
||||
* $4
|
||||
*/
|
||||
protected function $1($2)
|
||||
{
|
||||
return $this;
|
||||
$5;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ptf "Create a protected function" b
|
||||
public function $1()
|
||||
snippet pvf "Create a private function" b
|
||||
/*
|
||||
* $3.
|
||||
*
|
||||
* $4
|
||||
*/
|
||||
private function $1($2)
|
||||
{
|
||||
return $this;
|
||||
$5;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet php
|
||||
<?php $1 ?>
|
||||
<?php
|
||||
|
||||
$1
|
||||
endsnippet
|
||||
|
||||
snippet gs "Getter and setter"
|
||||
/*
|
||||
* Set the value of "$1".
|
||||
*
|
||||
* @param $2 \$$1
|
||||
*
|
||||
* @return $3
|
||||
*/
|
||||
public function set${1/\w+\s*/\u$0/g}(\$$1)
|
||||
{
|
||||
$this->$1 = \$$1;
|
||||
|
@ -31,6 +55,11 @@ public function set${1/\w+\s*/\u$0/g}(\$$1)
|
|||
return \$this;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the value of "$1".
|
||||
*
|
||||
* @return $2
|
||||
*/
|
||||
public function get${1/\w+\s*/\u$0/g}()
|
||||
{
|
||||
return \$this->$1;
|
||||
|
@ -60,6 +89,8 @@ snippet page "Create trinity page"
|
|||
|
||||
use Trinity\Bundle\ContentManagerBundle\Model\Page;
|
||||
use Trinity\Bundle\ContentManagerBundle\Model\Block;
|
||||
use Trinity\Bundle\ContentManagerBundle\Form\Type\BlockType;
|
||||
use Trinity\Bundle\ContentManagerBundle\Form\Type\TinymceAdvancedBlockType;
|
||||
|
||||
/**
|
||||
* Class `!p snip.rv = snip.basename`.
|
||||
|
@ -84,10 +115,9 @@ class `!p snip.rv = snip.basename` extends Page
|
|||
public function getConfiguration()
|
||||
{
|
||||
return $this->configuration
|
||||
->setDefaultController('FooBarBundle:MyController:bob')
|
||||
->setDefaultControllerClass('Foo\Bundle\BarBundle\Controller\MyController::bobAction')
|
||||
->setBlock('title', 'Trinity\Bundle\ContentManagerBundle\Form\Type\BlockType')
|
||||
->setBlock('content', 'Trinity\Bundle\ContentManagerBundle\Form\Type\TinymceAdvancedBlockType');
|
||||
->setDefaultControllerClass('${2:Foo}\Bundle\\${3:Bar}Bundle\Controller\\${4:My}Controller::${5:bob}Action')
|
||||
->setBlock('title', BlockType::class)
|
||||
->setBlock('content', TinymceAdvancedBlockType::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -176,6 +206,7 @@ class `!p snip.rv = snip.basename` extends ContainerAwareCommand
|
|||
// $output->writeln(sprintf('<comment>%s</comment> bar.', $example));
|
||||
// $input->getArgument('foo');
|
||||
// $input->getOption('bar');
|
||||
$4
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
@ -200,12 +231,14 @@ class `!p snip.rv = snip.basename` extends PageController
|
|||
*
|
||||
* @return \Symfony\Bundle\FrameworkBundle\Controller\Response
|
||||
*/
|
||||
public function indexAction(Request $request)
|
||||
public function $1Action(Request $request)
|
||||
{
|
||||
if ($response = $this->handleNodeSecurity($request)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$2
|
||||
|
||||
return $this->defaultRender();
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +264,7 @@ class `!p snip.rv = snip.basename` extends BaseAbstractType
|
|||
* @var array
|
||||
*/
|
||||
protected $options = [
|
||||
'name' => '',
|
||||
'name' => '$1',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -239,17 +272,18 @@ class `!p snip.rv = snip.basename` extends BaseAbstractType
|
|||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$2
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet array "Create array"
|
||||
array($1)
|
||||
[$1]
|
||||
endsnippet
|
||||
|
||||
snippet foreach "foreach"
|
||||
foreach (\$${1}s as \$$1) {
|
||||
|
||||
$2
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
@ -277,11 +311,6 @@ public function getBlock${1/\w+\s*/\u$0/}()
|
|||
}
|
||||
endsnippet
|
||||
|
||||
snippet title "Titelize in the Transformation"
|
||||
${1:a text}
|
||||
${1/\w+\s*/\u$0/g}
|
||||
endsnippet
|
||||
|
||||
snippet ind "inheritdoc comment" b
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
|
Loading…
Reference in a new issue