I'm making a page render class for a thing i'm making but when I go to do $this->session->userdata('username'); it says I can't access it.
the PageRender class is extending the controller so it can load view files for the template_header and template_footer. I also get the error above when I try to access the template parser class hence why i'm having it extend the Controller class instead. could someone help?
PageRender:
Code:<?php if (!defined('BASEPATH')){ exit('No direct script access allowed'); } class PageRender extends Controller{ function PageRender(){ parent::Controller(); } function generateHeader($loggedUser){ //$user = ($this->session->userdata('username')) ? $this->session->userdata('username') : 'Guest'; $headerData = array( 'pageHeading' => 'Nevux Ability Boards (1.4.6 Devel)', 'cssFiles' => array("style.css"), 'jsFiles' => array("jquery"), 'metaData' => array(), 'User' => $loggedUser, 'RenderInstance' => $this ); $this->load->view('templates/layout_header', $headerData); } function incorporateTemplate($templateData){ } function generateFooter(){ } function loadItems($type = null, $fileName = null, $metaKey = null, $metaData = null){ } } ?>


2Likes
LinkBack URL
About LinkBacks



Reply With Quote

