Feature #319

Support setter injection without configuration through "inject" methods

Added by Robert Lemke over 12 years ago. Updated over 9 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


PHP Version:
Has patch:


Currently setter injection is only possible via setter methods whose name follows the scheme "setPropertyName". These dependencies need to be configured explicitly in the Components.ini file because autowiring is not possible in this case.

It would be nice if there was (additionally) support for "inject" methods (setter methods with names like "injectPropertyName"). By convention these methods would be recognized as setters for dependencies and could be autowired.

inject* methods should be preferred over set* methods.

Associated revisions

Revision b12c43ac (diff)
Added by Robert Lemke over 12 years ago

  • FLOW3: (Component) Removed support for setter injection via generic "setProperty()" method.
  • FLOW3: (Component) Setter injection is now also possible via a "inject" method, e.g. injectSomeDependency() (instead of setSomeDependency). All methods whose name starts with "inject" will be included into the autowiring procedure. Therefore dependencies don't need to be configured explicitly in the Components.ini when "inject" methods are used. Resolves #319.
  • FLOW3: (Component) Added autowiring support for "inject" setter methods. Addresses #319.
  • Smarty: Added check against multiple definition of "SMARTY_DIR"
  • Testing, TYPO3, PhoneBookTutorial: Refactored to the new "inject*" methods in the action controllers.


#1 Updated by Robert Lemke almost 12 years ago

  • Target version deleted (18)

Also available in: Atom PDF