Welcome Guest, Not a member yet? Register   Sign In
Unable to access variable
#1

I have a BaseController which initiates some variables as follows;

public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->global_settings = $this->loadGlobalSettings();
$global_settings_cache = cache()->get('global_settings');
$this->data['dh_site_theme'] = $global_settings_cache['dh_site_theme'];
}

I then have UserPublic_Controller as follows:

namespace App\Controllers\User_public;
use App\Controllers\User_Public\UserPublic_Controller;
use App\Controllers\BaseController;
use App\Libraries\Theme;

class UserPublic_Controller extends BaseController{

protected function __construct(){

$this->data['user_public_css'] .= $dh_site_theme->theme_cdn($dh_site_theme);

}

I cannot understand why I cannot access $dh_site_theme ... it shows null. Even in the VIEW debug bar I can see it is set to "journal", one of the seems I have.

VIEW DATA / Debug bar.
dh_site_theme journal

Any help appreciated.
Reply


Messages In This Thread
Unable to access variable - by spreaderman - 03-26-2022, 08:49 PM
RE: Unable to access variable - by kenjis - 03-26-2022, 08:59 PM
RE: Unable to access variable - by iRedds - 03-26-2022, 09:04 PM
RE: Unable to access variable - by spreaderman - 03-26-2022, 09:37 PM
RE: Unable to access variable - by vitnibel - 03-27-2022, 12:45 AM
RE: Unable to access variable - by spreaderman - 03-27-2022, 01:14 AM
RE: Unable to access variable - by vitnibel - 03-27-2022, 03:01 AM
RE: Unable to access variable - by spreaderman - 03-27-2022, 05:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB