Skip to content

Instantly share code, notes, and snippets.

$this->extPath = t3lib_extMgm::extPath($this->extKey);
$view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
$view->setLayoutRootPath(t3lib_extMgm::extPath($this->extKey) . 'Resources/Private/Layouts/');
$view->setPartialRootPath(t3lib_extMgm::extPath($this->extKey) . 'Resources/Private/Partials/');
$view->setTemplatePathAndFilename($this->extPath . 'Resources/Private/Templates/File.html');
// initialize locallang
$view->getRequest()->setControllerExtensionName($this->extKey);
$view->assign('helloworld', $helloworld);
@andypa
andypa / Create eID script for TYPO3
Last active December 15, 2015 02:19
Create eID script for TYPO3
1. in ext_localconf.php:
$TYPO3_CONF_VARS['FE']['eID_include']['bar'] = 'EXT:foo/lib/class.tx_foo.php';
2. in lib/class.foobar.php
<?php
require_once(PATH_tslib.'class.tslib_pibase.php');
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1;
class tx_foobar extends tslib_pibase {
var $exclude = array('tt_news' => array(0));
@andypa
andypa / readLLfile
Last active December 18, 2015 12:08
Read a language file (locallang.xml, etc.) in a non-extension file
$labels = t3lib_div::readLLfile(t3lib_div::getFileAbsFileName('EXT:extensionname/Resources/Private/Language/locallang.xml'), $GLOBALS["TSFE"]->config["config"]["language"]);
@andypa
andypa / 0_reuse_code.js
Created November 18, 2013 14:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<VirtualHost *:80>
ServerName example.com
Redirect permanent / http://www.example.com/
</VirtualHost>
@andypa
andypa / debug mysql in typo3
Created November 28, 2013 07:46
debug mysql in typo3
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1;
echo $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery;
git submodule deinit -f .
git submodule init
RewriteEngine On
RewriteCond %{REQUEST_URI} !/mypage/$
RewriteRule ^(.*)$ http://www.mysite.com/ [L,R=301]

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@andypa
andypa / pushlock
Created May 9, 2019 11:15
execute composer update and directly commit the composer.lock and push it
alias pushlock='COMPOSER_DISCARD_CHANGES=stash composer update --no-interaction && git add composer.lock && git commit -m "[UPDATE] composer.lock" && git push'