This is the bit of code, it's a base class for my controller that initializes all common values. The file is in my models folder if that makes a difference. The weird thing is it works locally in MAMP where I'm developing, but not on the server. I'm thinking it may be a configuration issue?
<?php
Zend_Loader::loadClass('Zend_Controller_Action');
class BaseController extends Zend_Controller_Action
{
protected $auth;
protected $current_user;
protected $db;
protected function initialize_values()
{
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
{
$this->$current_user = $auth->getIdentity();
$this->view->user = $this->$current_user;
}
$this->db = Zend_Registry::get('dbAdapter');
$this->view->controller_name = $this->_request->getControllerName();
$this->view->view_name = $this->_request->getActionName();
}
}
I get it on the line that is first in the if statement
$this->$current_user = $auth->getIdentity();
I understood this error to mean it was trying to access a property or method that doesn't exist. In this case I know that exists