TYPO3.CMS 7.6 Schnipsel: Unterschied zwischen den Versionen
Aus Vosp.info
F (Diskussion | Beiträge) (→Url/Link erstellen) |
F (Diskussion | Beiträge) |
||
Zeile 44: | Zeile 44: | ||
</source> | </source> | ||
+ | == Domain == | ||
+ | * http://blog.teamgeist-medien.de/2014/09/extbase-repository-update-persistiert-nicht-nimm-den-vorschlaghammer.html | ||
= fluid = | = fluid = | ||
Version vom 18. Dezember 2015, 11:03 Uhr
Inhaltsverzeichnis
extbase (php)
Generell
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$ncmail = $objectManager->get('Netzcoop\Extension\Services\Ncmail');
logout / login
protected function login($ncfeuserid) {
$user = $this->userRepository->findByUid($ncfeuserid);
$GLOBALS['TSFE']->fe_user->createUserSession($user->_getProperties());
$GLOBALS["TSFE"]->fe_user->user = $GLOBALS["TSFE"]->fe_user->fetchUserSession();
// es wird empfohlen jetzt zu redirect'en
}
protected function logout() {
$GLOBALS['TSFE']->fe_user->logoff();
}
Controller
Url/Link erstellen
$uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->reset();
$uriBuilder->setArguments(array(
strtolower($this->extensionName) => array(
'param1' => $user->getUid(),
'param2' => 'test',
)
));
$uri = $uriBuilder->build();
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($uri, \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_303);
Domain
fluid
<f:format.html parseFuncTSPath="lib.parseFunc">{ancitscttnews.bodytext}</f:format.html>