[TYPO3-mvc] initializeAction how to instance repository from other extension?

Christine Gerpheide cgerpheide at gmail.com
Fri Mar 26 13:45:32 CET 2010


Hi,

I actually have a related question... I am using the
hook ['tslib/class.tslib_fe.php']['contentPostProc-all'] ( function
contentPostProcessing() ) so that I can alter page content, and I would like
to have access to the repository from within this hook.  However, I'm
getting the fatal error that my repository class is not found (the folder
structure etc is correct because it works within my extension normally).
 The extension containing the repository is not added on the page that I'm
trying to use the hook in (but it is installed), and I notice also that no
plugin content is not rendered by the time I am calling the hook, if that's
relevant.  I'm not really familiar with how the spl autoload register
works... but is this expected to work here?  And if not, is there any way
(another hook maybe?) I can use to process page content and use the
repository and other models from my extension?  I have placed my hook within
my extension, in myext/Classes/Hook/ContentPostProcHook.php.

Thanks,
Christine

2010/3/26 Peter Niederlag <typo3-list at niekom.de>

> Hello,
>
> ralph schrieb:
> [...]
> >  public function initializeAction() {
> >     other instances from own plugin
> >     $this->someRepository =
> > t3lib_div::makeInstance('Tx_My_Domain_Model_SomeRepository');
> > }
> > any hints how to make the foreign repository accessible?
>
> $this->whatEverRepository =
> t3lib_div::makeInstance('Tx_Extkey_Domain_Model_WhateverRepository');
>
> just works if 'Extkey' is loadad and has 'WhateverRepository' in the
> appropriate folder.
>
> Really BIG Thx to usage of _spl_autoload_register here. :->
>
> [...]
>
> Greets,
> Peter
> --
> Peter Niederlag
> http://www.niekom.de * TYPO3 & EDV Dienstleistungen *
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list