Zum Inhalt springen

Extbase $this->configurationManager->getConfiguration view leer

Erstellt am 6. Mai 2012 · 4 Antworten · letzte Antwort am 9. Mai 2012

Tags: Frage

rleuthold ·

Hallo Zusammen,

Zuerst einmal - ja, das ist ein Cross Posting. Da ich im anderen Forum keine Antwort erhalten habe, versuche ich es mal hier bei Euch, denn hier gibt es für Extbase / Fluid Entwicklung ein eigenes Thema (Leider konnte ich den Thread im anderen Forum nicht löschen).

So, nun zu meinem Problem:

Ich entwickle eine neue Extbase / Fluid Extension. Die Basis der Extension und das Domain Model lieferte der ExtensionBuilder.

Nun möchte ich aus einem Controller auf die TypoScript Variable

plugin.tx_abounitreservation.view.templateRootPath

zugreifen.

Das geht laut verschiedenen Quellen auf dem Netz ganz einfach so:

$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);        
$templateRootPath = t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']);

Leider sieht dann das beim Debuggen bei mir so aus:

Bild: dl.dropbox.com/…/debugger-configuration.png

Alle variablen im view sind leer.

Mein TypoScript sieht so aus:

constants.txt

plugin.tx_abounitreservation {
    view {
        # cat=plugin.tx_abounitreservation/file; type=string; label=Path to template root (FE)
        templateRootPath = EXT:abo_unit_reservation/Resources/Private/Templates/
        # cat=plugin.tx_abounitreservation/file; type=string; label=Path to template partials (FE)
        partialRootPath = EXT:abo_unit_reservation/Resources/Private/Partials/
        # cat=plugin.tx_abounitreservation/file; type=string; label=Path to template layouts (FE)
        layoutRootPath = EXT:abo_unit_reservation/Resources/Private/Layouts/
    }
    persistence {
        # cat=plugin.tx_abounitreservation//a; type=string; label=Default storage PID
        storagePid = 
    }
}

setup.txt

plugin.tx_abounitreservation {
    view {
        templateRootPath = {$plugin.tx_abounitreservation.view.templateRootPath}
        partialRootPath = {$plugin.tx_abounitreservation.view.partialRootPath}
        layoutRootPath = {$plugin.tx_abounitreservation.view.layoutRootPath}
    }
    persistence {
        storagePid = {$plugin.tx_abounitreservation.persistence.storagePid}
    }
}

Sieht für mich alles ganz richtig aus. Hat irgend jemand eine Idee, warum das nicht klappt?

Grüsse & Danke
Rico

freshman17 ·

Wo erfolgt der Aufruf, im FE oder BE? Unabhängig davon, kommst du an das ganze TS so dran:

$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);

Ansonsten siehe hier.

rleuthold ·

Danke für Deine Antwort!

Der Aufruf erfolgt im Controller, welcher wiederum aus der View (Fluid Template) aufgerufen wird.

Wenn ich das gesamte TS wie von Dir vorgeschlagen abfrage, findet sich das view array mit den Template Paths unter:

plugin.tx_abounitreservation.view

Bild: dl.dropbox.com/…/CONFIGURATION_TYPE_FULL_TYPOSCRIPT.png

Ich sehe aber auch diese Vorgehensweise eher als einen Workaround für die eigentlich dafür vorgesehene Methode:

$this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
freshman17 ·

also bei funktioniert das:

$extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(
	Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT
);
rleuthold ·

Ich denke, ich habe herausgefunden, warum es nicht funktioniert hat. Das TS template war nicht richtig eingebunden (Include und so ;-))!