Welcome Guest, Not a member yet? Register   Sign In
Passing Variables from one controller to its extended controller
#5

[eluser]xtremer360[/eluser]
I have the following and its not giving me an error anywhere. I am working locally. I have a bet that its not getting tht cms template variable in the login controller but I don't know. I had to remove the <> characters so it'll show that line of code.
Code:
&lt;?php
if (! defined('BASEPATH')) exit('No direct script access allowed');

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

Code:
&lt;?php

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

class Kowmgr_login extends Backend_Controller {

public function __construct()
{
  parent::__construct();
}

public function index()
{
  $message_box_messages = array();
  $css_page_addons = '';
  $js_page_addons = 'script src='assets/' .$cms_template. '/js/validation/login_form.js/script';
  $meta_tag_addons = '';
  $site_title = 'KOW Manager Login';
  
  $page_view = 'login_view';
  
  if (count($message_box_messages) !== 0)
  {
   $message_boxes = $this->functions_model->build_message_boxes_output(array('display' => 'show', 'message' => $message_box_messages));
  }
  else
  {
   $message_boxes = array('display' => 'none');
  }
  
  if (isset($site_title) && (empty($site_title)))
  {
   $site_title = $this->functions_model->site_title();
  }
  
  $this->data['message_boxes'] = $message_boxes;
  $this->data['css_page_addons'] = $css_page_addons;
  $this->data['js_page_addons'] = $js_page_addons;
  $this->data['site_title'] = $site_title;
  $this->data['page_view'] = $page_view;
  
  $this->load->view('cms/' . $cms_template . '/usermanagement/index_view', $this->data);
}
}


Messages In This Thread
Passing Variables from one controller to its extended controller - by El Forum - 01-08-2013, 01:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB