[TYPO3-dev] [BE] makeInstance and call userfunc
Gijs Epping
gijs.epping at efocus.nl
Tue Jan 29 14:47:25 CET 2008
Hello,
I am trying to call a frontend plugin function from a other frontend
plugin extension. I am doing this because i need some allready writen
html output in my ajax called page. I creating my own ajax page, no
content or templates just empty so i can easely dump the html output
generated by the function to the screen. May be this is not the correct
way in typo3 any suggestions that can help me with these kind of ajax
calls will help.
This is some of the code i was experimenting with.
***************************
require_once(PATH_tslib.'class.tslib_pibase.php');
require_once(t3lib_extMgm::extPath('ef_rpho').'pi1/class.tx_efrpho_pi1.php');
class tx_efrpho_pi3 extends tslib_pibase{
<more code>
//example
function getpi1content($content,$conf){
$cObj = t3lib_div::makeInstance("tx_efrpho_pi1");
$contentPi1 = $cObj->main($content,$conf);
return $contentPi1;
}
<more code>
}
****************************
As you might gues this is not working because $conf is containing some
other values How can initiate tx_efrpho_pi1 like it's being executed on
the front and only get the result back like the example above.
Function tx_efrpho_pi1->main contains some html output i don't want to
retype in tx_efrpho_pi3 so i thought why not use the other class. As you
would do normally with own defined classes.
like so:
****************************
include "class1.php";
class class2{
function main(){
$class1 = new Class1();
$content = $class1->main();
return $content;
}
}
**************************/*
Well is this in anyway possible and if you say yes! How?
Regards Gijs
More information about the TYPO3-dev
mailing list