Welcome Guest, Not a member yet? Register   Sign In
Accessing variables in controllers and views
#1

[eluser]xtremer360[/eluser]
Trying to figure out if this is the correct way to deal with the cms_template variable and if there's a simpler way I can do this. And if so how do do I properly access the cms_template in other controllers and also in views.

Code:
<?php

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Backend_Controller extends MY_Controller
{
    protected $cms_template = '';
    
public function __construct()
{
  parent::__construct();
  $this->cms_template = $this->config->item('cms_template');
  $this->data['cms_template'] = $this->cms_template;
}
}



Messages In This Thread
Accessing variables in controllers and views - by El Forum - 01-09-2013, 01:21 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 02:33 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 02:36 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 02:43 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 03:00 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 03:21 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 03:32 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 03:40 PM
Accessing variables in controllers and views - by El Forum - 01-09-2013, 08:48 PM
Accessing variables in controllers and views - by El Forum - 01-10-2013, 05:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB