Sushimaster
Member
Hi there,
here's my code, just want to display the visitor's menu somewhere else (external app):
Error is always
What am I doing wrong...?
here's my code, just want to display the visitor's menu somewhere else (external app):
PHP:
// fileDir is correct, don't get confused
$fileDir = "../";
require $fileDir . '/src/XF.php';
XF::start($fileDir);
$app = XF::setupApp('XF\Pub\App');
$app->start();
$templater = $app->templater();
$viewParams = [];
$output = $templater->renderTemplate('public:account_visitor_menu', $viewParams);
\XF::dump($output);
/* This also won't work
$widgetRenderer = $templater->renderWidget('widget_visitor_panel', []);
\XF::dump($widgetRenderer->render());
*/
Error is always
An exception occurred: [Error] Call to a member function getProperty() on null in src/XF/Template/Templater.php on line 2010
- XF\Template\Templater->getFallbackAvatarHtml() in src/XF/Template/Templater.php at line 1903
- XF\Template\Templater->getDynamicAvatarHtml() in src/XF/Template/Templater.php at line 1854
- XF\Template\Templater->fnAvatar()
- call_user_func_array() in src/XF/Template/Templater.php at line 941
- XF\Template\Templater->func() in internal_data/code_cache/templates/l2/s0/public/account_visitor_menu.php at line 12
- XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 706
- XF\Template\Templater->callMacro() in internal_data/code_cache/templates/l2/s0/public/account_visitor_menu.php at line 178
- XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 1320
- XF\Template\Templater->renderTemplate() in /path/to/my.php at line 37
- myfunc() in /path/to/my.php at line 142
What am I doing wrong...?