snippet ns "namespace declaration" b namespace ${1:`!p abspath = os.path.abspath(path) m = re.search(r'([^/]+)/Classes/(.+(?=/))', abspath) if m: snip.rv = 'Qbus\\' + \ re.sub(r'(^|_)([a-zA-Z])', lambda m: m.group(2).upper(), m.group(1)) + \ '\\' + m.group(2).replace('/', '\\') else: m = re.search(r'[A-Z].+(?=/)', abspath) if m: snip.rv = m.group().replace('/', '\\') `}; endsnippet snippet class "Class declaration template" b $2 = $$2; } $0 endsnippet snippet setter "PHP Class Setter" b /** * Setter for $1 * * @param ${2:string} $$1 * @return void */ public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) { $this->$1 = $$1;$5 } $0 endsnippet snippet getobj "ObjectManager->get" b /* @var \$$2 $1 */ \$${2:${1/.*(?:^|\\)([^\\]+)$/\l$1/}} = $this->objectManager->get(${1:\Vendor\Extension\ClassName}::class); endsnippet snippet inst "TYPO3 makeInstance" b /* @var \$${3:$2} $1 */ \$${2:${1/.*(?:^|\\)([^\\]+)$/\l$1/}} = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(${1:\Vendor\Extension\ClassName}::class); endsnippet snippet dump "TYPO3 var_dump" b \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($1); endsnippet snippet dpb "debug_print_backtrace " b debug_print_backtrace(${1:DEBUG_BACKTRACE_IGNORE_ARGS}); endsnippet snippet action "Extbase Controller action" b /** * action $1 * * @return void */ public function ${1:index}Action(${2}) { ${VISUAL}${3} } $0 endsnippet snippet ifqbus "ifqbus" b if ($_SERVER['REMOTE_ADDR'] == '217.92.160.135') { ${1} } endsnippet snippet exc "exc" b throw new \\${2}Exception("$1", `!p import time snip.rv = int(time.time()) `); endsnippet snippet pl "configure TYPO3 Plugin" b \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( 'Qbus.' . $_EXTKEY, '${1:PluginName}', [ '${2:ControllerName}' => '${3:list,show}', ], [ '$2' => '${4}', ] ); endsnippet snippet pt "Add TYPO3 plugin in ext_tables.php" b \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( $_EXTKEY, '${1:PluginName}', '${2:Description}' ); endsnippet snippet gs "PHP Class Getter Setter" b /** * Getter for $1 * * @return ${2:string} */ public function get${1/\w+\s*/\u$0/}() { return $this->$1;$3 } /** * Setter for $1 * * @param $2 $$1 * @return ${4:`!p snip.rv=snip.basename`} */ public function set${1/\w+\s*/\u$0/}(${5:${2/(void|string|int|integer|double|float|object|boolean|bool|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) { $this->$1 = $$1;$6 ${7:return $this;} } $0 endsnippet