JackBauer
Member
I have a website that uses Phalcon. The directory structure looks like this:
I'm trying to register a visitor component with the Phalcon IoC container like this:
Then my controller action is pretty simple:
The problem is this displays absolutely nothing on the page. There are no errors in XenForo logs, Apache logs or otherwise. If I put the guts of that function in my controller action it works just fine:
Anyone know anything about Phalcon that can help me with this?
Code:
mysite
-- app
---- controllers
------ IndexController.php
-- forums
---- (XenForo stuff here)
I'm trying to register a visitor component with the Phalcon IoC container like this:
Code:
$di->set('visitor', function () {
\XenForo_Autoloader::getInstance()->setupAutoloader('/mysite/forums/library');
\XenForo_Application::initialize('/mysite/forums/library', '/mysite/forums', true, array('resetOutputBuffering' => false));
\XenForo_Session::startPublicSession();
$visitor = \XenForo_Visitor::getInstance();
return $visitor;
});
Then my controller action is pretty simple:
Code:
public function indexAction()
{
echo $this->visitor->get('username');
}
The problem is this displays absolutely nothing on the page. There are no errors in XenForo logs, Apache logs or otherwise. If I put the guts of that function in my controller action it works just fine:
Code:
public function indexAction()
{
\XenForo_Autoloader::getInstance()->setupAutoloader('/mysite/forums/library');
\XenForo_Application::initialize('/mysite/forums/library', '/mysite/forums', true, array('resetOutputBuffering' => false));
\XenForo_Session::startPublicSession();
$visitor = \XenForo_Visitor::getInstance();
echo $visitor->get('username');
}
Anyone know anything about Phalcon that can help me with this?