Plugin: Inhalt vom Konfigurations Formular auslesen

Hallo ich habe ein Plugin erstellt, welches auch noch ein paar Formulardaten hat, die in den Grundeinstellungen gepflegt werden. Aber ich komme nicht an die Inhalte. Ich habe einfach mal in meinem Frontend Controller das hier aufgerufen: var\_dump( Shopware()-\>Plugins()-\>Frontend()-\>Idealnewsflat()-\>Config() ); Das ergibt dann folgenden Fehler: [quote] Ups! Ein Fehler ist aufgetreten! Die nachfolgenden Hinweise sollten Ihnen weiterhelfen. Plugin “Idealnewsflat” not found failure in Enlight/Plugin/PluginCollection.php on line 113 Stack trace: #0 Enlight/Plugin/Namespace/Config.php(102): Enlight_Plugin_PluginCollection->load(‘Idealnewsflat’, true) #1 Enlight/Plugin/PluginCollection.php(97): Enlight_Plugin_Namespace_Config->load(‘Idealnewsflat’, true) #2 Enlight/Plugin/PluginCollection.php(127): Enlight_Plugin_PluginCollection->get(‘Idealnewsflat’, true) #3 Shopware/Plugins/Community/Frontend/idealnewsflat/Controllers/Frontend/Idealnewsflat.php(20): Enlight_Plugin_PluginCollection->__call(‘Idealnewsflat’, Array) #4 Shopware/Plugins/Community/Frontend/idealnewsflat/Controllers/Frontend/Idealnewsflat.php(20): Shopware_Components_Plugin_Namespace->Idealnewsflat() #5 Enlight/Controller/Action.php(135): Shopware_Controllers_Frontend_Idealnewsflat->indexAction() #6 Enlight/Controller/Dispatcher/Default.php(521): Enlight_Controller_Action->dispatch(‘indexAction’) #7 Enlight/Controller/Front.php(214): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #8 Shopware/Bootstrap.php(79): Enlight_Controller_Front->dispatch() #9 Enlight/Application.php(192): Shopware_Bootstrap->run() #10 shopware.php(74): Enlight_Application->run() #11 {main} [/quote] Das Plugin hat aber den Namen, weil ich es in der Bootstrap doch hiermit declariere: public function getLabel() { return "Idealnewsflat"; } Was könnte ich verbaselt haben? Vielen Dank1

Ich sehe gerade, dass ich das hier aufgeschnappt habe: http://wiki.shopware.de/Die-Shopware-Pl … l_760.html Das ist eine SW 3.x Doku - ist das noch aktuell oder gibt es SW 4.x betreffend etwas anderes?

Hallo, Anleitungen gibt es hier: wiki.shopware.de/Frontend_cat_870.html Du braucht folgenden Code in der Bootstap.php: public function onPostDispatch(Enlight\_Event\_EventArgs $args) { $request = $args-\>getSubject()-\>Request(); $response = $args-\>getSubject()-\>Response(); $view = $args-\>getSubject()-\>View(); $view-\>addTemplateDir($this-\>Path() . '/views/'); if (!$request-\>isDispatched() || $response-\>isException() || $request-\>getModuleName() != 'frontend') { return; } $config = $this-\>Config(); $view-\>variable1 = $config-\>variable1; $view-\>variable2 = $config-\>variable2; $view-\>variable3 = $config-\>variable3; ... //\* Hier alle Variablen übergeben \*/ $view-\>filePath = $this-\>Path() . '/views/'; ... $view -\> extendsTemplate('frontend/plugins/dein\_Plugin/template.tpl'); return; }

1 „Gefällt mir“

Vielen Dank, das hat funktioniert! :slight_smile: