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