TypoScript Ajax

ajaxCall = PAGE
ajaxCall {
typeNum = 999
config {
disableAllHeaderCode = 1
xhtml_cleaning = 0
admPanel = 0
additionalHeaders = Content-type: text/plain
no_cache = 1
debug = 0
}
10 < lib.stdContent }

findByUidsString (3,5,7)

public function findByUidsString($uids) {
    $uidArray = explode(",", $uids);
    $query = $this->createQuery();
    $query->getQuerySettings()->setRespectStoragePage(false);
    $query->matching(
        $query->in('uid', $uidArray),
        $query->logicalAnd(
            $query->equals('hidden', 0),
            $query->equals('deleted', 0)
        )
    );
    $query->setOrderings($this->orderByUidsString('uid', $uidArray)); 
    return $query->execute();
}
protected function orderByUidsString($field, $values) {
    $orderArray = array();
    foreach ($values as $value) {
        $orderArray["$field={$value}"] = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING;
    }
    return $orderArray;
}

executeSqlString

$query = $this->createQuery();    
$query->statement($sqlString);
$model = $query->execute();

Extbase querySettings

$query->getQuerySettings()->setRespectStoragePage(false);
$query->getQuerySettings()->setRespectSysLanguage(false);
$query->getQuerySettings()->setIgnoreEnableFields(true);

PHP log Debug

unlink("logger.log");
error_log(print_r($mixedArray,true), 3, "logger.log");

GET google location

$address = urlencode(trim($street).'+'.trim($plz).'+'.trim($ort));
$url = "http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=Germany";
$json = json_decode($file_get_contents($url));
$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
$long = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};

Signals, Slots mit Powermail

ext_localconf.php

$methodName = 'savePowermailData';
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\SignalSlot\Dispatcher')->connect(
        'In2code\Powermail\Controller\FormController',
        'createActionAfterMailDbSaved',
        'Vendor\ExtensionName\Domain\Slot',
        $methodName
);

Vendor\ExtensionName\Domain\Slot.php

class Slot  
{
    public function savePowermailData(\In2code\Powermail\Domain\Model\Mail $mail)
    {
    }
}

debug Function

	private function debug($mixedValue){
                  DebuggerUtility::var_dump($mixedValue);
	        \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($mixedValue);
	}
	private function debugLog($mixedValue){
	        unlink("logger.log");
			error_log(print_r($mixedArray,true), 3, "logger.log");
	}

    /**
     * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult
     * @param boolean $explainOutput
     * @return void
     */
    public function debugQuery(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult, $explainOutput = FALSE){
        $GLOBALS['TYPO3_DB']->debugOutput = 2;
        if($explainOutput){
            $GLOBALS['TYPO3_DB']->explainOutput = true;
        }
        $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;
        $queryResult->toArray();
        \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
        $GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;
        $GLOBALS['TYPO3_DB']->explainOutput = false;
        $GLOBALS['TYPO3_DB']->debugOutput = false;
    }

Enable debug info
config.contentObjectExceptionHandler = 0

GET templateRootPath

$templateRootPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($config['view']['templateRootPath']);

sample.xml To $xmlArray

$xmlContent = file_get_contents($this->getTemplateRootPath().'sample.xml');
$xmlArray = GeneralUtility::xml2array($xmlContent);