Guten Abend zusammen.
Seit kurzer Zeit beschäftige ich mich mit dem interessanten Thema der Dependency Injection und komme gerade nicht so recht weiter.
Kann es sein, dass die Dependency Injection im Extbase ActionController nicht für Utility-Klassen funktioniert?
<?php /** * Foo of the bar */ class Tx_Foo_Controller_ContentToolsController extends Tx_Extbase_MVC_Controller_ActionController { /** * @var Tx_Foo_Utility_Div */ protected $divObj; /** * Dependency injection of the Div Object * * @param Tx_Foo_Utility_Div $divObj * @return void */ public function injectDivObj(Tx_Foo_Utility_Div $divObj) { $this->divObj = $divObj; } /** * @return void */ public function indexAction() { $this->divObj->fooBar(); } ... }
Das Resultat im FE lautet: [b]Fatal error: Call to a member function fooBar() on a non-object...[/b]
Vielen Dank im Voraus, ich bin für jede Hilfe dankbar.
Einen schönen Abend!